nguyentientoan / socialauth-net

Automatically exported from code.google.com/p/socialauth-net
0 stars 0 forks source link

Google provider doesn't return email address (2.4) #193

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Login using Google provider
2. Use SocialAuthUser.GetCurrentUser().GetProfile().Email
3. Email is blank

What is the expected output? a usable email address

What version of the product are you using? 2.4
On what operating system? Win 8, Chrome

Please provide any additional information below.

Original issue reported on code.google.com by davidfor...@gmail.com on 7 Nov 2013 at 2:46

GoogleCodeExporter commented 8 years ago
I faced the same problem today, I simply had to change the GoogleWrapper 
AdditionalScopes in order to get the e-mail, ex: AdditionalScopes="openid 
profile email"

Regards

Original comment by mzi...@mono.hr on 11 Nov 2013 at 5:29

GoogleCodeExporter commented 8 years ago
With GoogleWrapper (OAuth 2.0), unlike GoogleHybridWrapper, you need to 
explicitly pass the permission request to fetch email (illustrated in Demo 
application).

All you need is to append following in the config entry for Google Wrapper:
AdditionalScopes="https://www.googleapis.com/auth/userinfo.email"

You should start getting email after specifying this.

Original comment by deepak.a...@3pillarglobal.com on 16 Feb 2014 at 8:05