Skip to content
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.

How to get additional fields using the Facebook provider in RC1? #783

Closed
@gdoron

Description

@gdoron

I'm using ASP.NET core RC1 (and can't upgrade to the not yet release RC2 nightly builds because of the lack of VS support in RC2).

I'm trying to get additional fields from Facebook (first_name, last_name, email and significant_other).

I used the code suggested on this issue:

app.UseFacebookAuthentication(options =>
{
    options.AppId = Configuration["Authentication:Facebook:AppId"];
    options.AppSecret = Configuration["Authentication:Facebook:AppSecret"];
    options.Scope.Add("email");
    options.Scope.Add("user_relationships");
    options.BackchannelHttpHandler = new HttpClientHandler();
    options.UserInformationEndpoint = 
        "https://graph.facebook.com/v2.5/me?fields=id,email,first_name,last_name,significant_other";

This solution indeed returns the email of the user, but fails with first_name, last_name and significant_other (and any other field I tried besides name, id and email).

Also, is it possible getting the FB access token? We might need it for future querying of other edges, or use it to manually query Facebook because ASP.NET Core has a bug (at least in RC1).

I need a way, even if not the cleanest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions