gapi authorize returns access_denied from website on mobile but works from desktop

123 Views Asked by At

I have a web application which sends an email using gmail api. The email sends from Google chrome desktop version but not from a mobile (android 10). At the bottom of my html, I include this script...

<script src="https://apis.google.com/js/client.js"></script>

My authorize code looks like:

checkAuth: function () {
    var self = this;
    gapi.auth2.authorize({
        client_id: *myClientId*,
        scope: *myScopes*,
        prompt: 'none',
        response_type: 'permission',
        login_hint: '*my email address*'
    }, self.handleAuthResult);
}

The response I get is:

{"error":"immediate_failed","error_subtype":"access_denied"}

I suspect the issue is in my app credentials in the google cloud platform but I don't know how to tell it to accept use from a mobile.

  • API restrictions: 'Gmail API'
  • Application restrictions: none

Any ideas?

0

There are 0 best solutions below