Reputation: 161
I need to find the user response for authorised request in identification to his gmail account, Actually am trying to send mail regarding the authentication from developers account to users. When user clicks Allow then calendar events are created in their calendar.
But when they deny, Exception pops out stating Not authorised user. I need to find the user mail id and what user doing accepting or denying ? Yeah I tried this link
Example :
but i am getting error:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "insufficientPermissions",
"message": "Insufficient Permission"
}
],
"code": 403,
"message": "Insufficient Permission"
}
}
Need Assistance Guys.
Upvotes: 0
Views: 530
Reputation: 161
I requested for this
I got the response
from the above response i copied the access token and requested for https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=ya29.Ci82A-6MUVXaOQ1Hi1znc3wBF8Dm_iaI6OXjJtDvmK3NRB0DFYZNq221v7YU1QHwJA Its not because of scope. The url is working but i am unable to find the User Account Email id.
Upvotes: 0
Reputation: 867
How did you get the above access_token "ya29.Ci82A9-AcdxxjkatYj5NxwaxmJJybeOq7JwqhBUOCYpFM9xpBKHrWlEVULea4OfM_Q" at the first place?
If you provide the proper auth scope and add along "email" (perhaps also "profile" or "openid") in the scope string, you will be able to retrieve the authenticated user's email address (and other profile/openid details).
Anyway, I suspect the issue you encountered is due to the incorrect scope being specified.
https://developers.google.com/identity/protocols/OpenIDConnect
Upvotes: 1