Burjua
Burjua

Reputation: 12706

Is it possible to get user email using Google api without requesting access to Contacts

I'm trying to implement sign in with Google using Oauth (using DotNetOpenAuth). I need to get user name, Id and email from Google. Basically I can get all the info apart from the email from Profile Information requesting access for this scope: https://www.googleapis.com/auth/userinfo.profile

Unfortunately it doesn't return user email. I know that I can get user email requesting access to contacts, but I don't want to ask for such access.

Is it possible? Where can I read about what profile information is accessible via api. I found this scope uri here on SO, it works, but I can't fing anything about it in Google api docs.

Thanks

Upvotes: 1

Views: 3205

Answers (1)

Burjua
Burjua

Reputation: 12706

Ok, I found the solution partly in this question: Require Google to return email address as part of OAuth

So basicly I asking for access to basic info and email using this urls:

https://www.googleapis.com/auth/userinfo.profile

https://www.googleapis.com/auth/userinfo.email

and then quering the data using this url:

https://www.googleapis.com/oauth2/v1/userinfo

I'm using DotNetOpenAuth, which has examples so it is not so difficult to do

Upvotes: 4

Related Questions