Simply, i just 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,

below is the code for what i used in mvc 5 along with facebook sdk nuget,

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));
                }
            }
        });

thanks in advance.

Related posts

Recent Viewed