This repository was archived by the owner on Dec 13, 2018. It is now read-only.
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
Can't get email claim from Facebook #435
Closed
Description
Using beta7 packages. In my startup:
services.Configure<FacebookAuthenticationOptions>(options =>
{
options.AppId = Configuration["Authentication:Facebook:AppId"];
options.AppSecret = Configuration["Authentication:Facebook:AppSecret"];
options.Scope.Add("email");
});
However, inside AccountController.ExternalLoginCallback, I get back these claim types in the ExternalPrincipal:
- "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"
- "urn:facebook:name"
- "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
In the Fiddler traffic, I can see that it’s calling the FB Graph API and getting:
{"name":"xxx","id":"xxxx"}
If I modify the request to ask for email and replay it, then I do get the email, so I think my scope is correct
GET https://graph.facebook.com/v2.2/me?fields=id,name,email&access_token=blah
Response:
{"id":"xxx","name":"xxxx","email":"xxx"}