Link: https://sites.google.com/site/oauthgoog/Home/emaildisplayscope
From the link above I add the email scope
https://www.googleapis.com/auth/plus.me
https://www.googleapis.com/auth/userinfo.email
But I dont understand the following
Once you have a valid OAuth token, you can use it to make API calls to the Email Display API endpoint: https://www.googleapis.com/userinfo/email If the token is not valid, a 401 error will be returned. If the token is valid, then the user's Email address will be returned. The API will also return a boolean value to indicate whether Google has verified that the user owns that Email address. However most installed applications will ignore that value.
How to make a call to the Email Display API endpoint? Using https://www.googleapis.com/userinfo/email
Now we use GoogleAPI with Google+
As on December 2013, here is the most updated website;
https://developers.google.com/+/
Then for SignIn for Web
https://developers.google.com/+/web/signin/
Choosing a sign-in flow
->Client-side flow
->Initiate the sign-in flow with JavaScript (I believe this is the latest technology)
https://developers.google.com/+/web/signin/javascript-flow
https://developers.google.com/+/web/api/javascript#gapiauthsigninparameters
https://developers.google.com/+/web/signin/javascript-flow
https://google-developers.appspot.com/+/demos/signin_demo_render (SourceCode)
You will try this and for your own, follow
Step 1: Create a client ID and client secret
Ignore the following step,
Actually, you need clientID only and replace the one in the source code of Try it above.
Add scope https://www.googleapis.com/auth/userinfo.email
Add
Here is the full working and concise code based on the above:
No HTML output, but console. so open browser's Developers Console tools to view the result.
Set your scopes to:
And use the endpoint:
https://www.googleapis.com/oauth2/v1/userinfo?alt=json
Usage:
You will get JSON:
The scopes have changed for Google+ Sign-In.
Set your scopes to:
The JavaScript calls look like this:
More information https://developers.google.com/+.
Edit: Note that you do not need scopes for plus.me or userinfo.profile.
I did this in angularjs, in the Ionic framework, and it works., try this.