Interested in this question: How to get information about a user (Public Profile) or avatar when logging in via Facebook? Interested in implementation on ASP.NET 5 / MVC 6.

Here is the code segment from the Startup.cs file:

services.Configure<FacebookAuthenticationOptions>(options => { options.AppId = Configuration["Authentication:Facebook:AppId"]; options.AppSecret = Configuration["Authentication:Facebook:AppSecret"]; options.Scope.Add("public_profile"); }); /* ....... */ app.UseFacebookAuthentication(); 

At authorization I receive Claim which contains only a full name (Full Name).

But how to get for example an avatar or Email user?

Need to use OAuth?

If so, how?

  • Avatar is easy: https://graph.facebook.com/USER_FACEBOOK_UID/picture?type=square&height=100&width=100 In order to get soap, you need to ask permission from the user, but the user may not give them and you won't get soap. How it is done on asp.net I don’t know - BOPOH
  • Judging by the parameters, OAuth2 is already used inside. It is necessary to look at the documentation for the authentication class. If it is possible for them to decide, then it is written there, as. - D-side

0