I want to know how add more permissions to Facebook external login and specially the email one. The external login works fine but I can't seem to replicate the same code that was working for MVC 5 into this one, so this is what I have for now:
services.Configure<FacebookAuthenticationOptions>(options =>
{
options.AppId = Configuration["Authentication:Facebook:AppId"];
options.AppSecret = Configuration["Authentication:Facebook:AppSecret"];
options.Scope.Add("email");
});
but it doesn't add the email permission.
This is the code which I used in MVC 5 along with Facebook SDK nugget:
app.UseFacebookAuthentication(new FacebookAuthenticationOptions
{
AppId = "XXXXXX",
AppSecret = "XXXXXXX",
Scope = { "email" },
Provider = new FacebookAuthenticationProvider
{
OnAuthenticated = async context =>
{
context.Identity.AddClaim(new System.Security.Claims.Claim("FacebookAccessToken", context.AccessToken));
}
}
});