I'm trying to get a user's date of birth and avatar/icon/photo/picture when he or she logs into my MVC5 site with a Google account.
I've read this:
Get ExtraData from MVC5 framework OAuth/OWin identity provider with external auth provider
but it doesn't make much sense ... ... am I suppose to know this?
In my Startup.Auth.cs file i have this snippet:
var gProvider = new GoogleAuthenticationProvider { OnAuthenticated = context => { var claims = context.Identity.Claims.ToList(); return Task.FromResult(0); } };
var gOptions = new GoogleAuthenticationOptions { Provider = gProvider };
app.UseGoogleAuthentication(gOptions);
The claims variable contains 5 items: (each item starts with 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/')
0: { nameidentifier: https://www.google.com/accounts/.../id?id... }
1: { givenname: Benjamin }
2: { surname: Day }
3: { name: Benjamin Day }
4: { emailaddress: ben@sillypenguin.net }
Can anyone help point out what I'm doing wrong or what I'm missing to get the extra profile data I'm looking for?