How to get facebook user profile picture in asp.net MVC RC2 kernel

Using ASP.NET Core MVC RC2 I am trying to get a Facebook user profile picture. To do this, I have the following lines in the Configure method of the Startup class

            app.UseFacebookAuthentication(new FacebookOptions()
        {
            AppId = Configuration["Authentication:Facebook:AppId"],
            AppSecret = Configuration["Authentication:Facebook:AppSecret"],
            Scope = { "user_birthday" },
            Fields = { "birthday", "picture" },
        });

In the AccountControllers ExternalLoginCallback method, I expected to see the data for the image in the ClaimsPrincipal collection, which can be accessed through info.Principal, but I do not see any claims related to the image.

Is this the right way to get a Facebook user profile picture or am I missing something?

+2
source share
1 answer

, , ( ).

Facebook, API Facebook () UserInformationEndpoint (https://graph.facebook.com/v2.6/me).

Facebook API, (, - Facebook Graph API. Picture).

, Facebook ASP.Core , CreateTicketAsync FacebookHandler class - .

+2

Source: https://habr.com/ru/post/1677685/


All Articles