Not seeing FacebookOptions.Fields collection? #620
Comments
Hey, FYI, That said, you should be able to specify the fields directly in |
Hi there, Thanks for writing back. The default value of UserInformationEndpoint seems to be just the URL without the query string. I think that the code expects to append the query string itself. I did find a post that gave me a little direction (http://stackoverflow.com/questions/20378043/getting-the-email-from-external-providers-google-and-facebook-during-account-ass). Adding
to Startup.cs seemed to make some progress... Facebook's OAuth page was now acknowledging that my app wanted the user's primary email address. This is what I was really after when I was looking into the Fields collection. The bummer part is that the standard code in AccountCountroller's ExternalLoginCallback to get the email out of the returned claims isn't working for me:
The value of email is null. Any insights? I did find that my Facebook "app" hadn't yet been switched to "live". I switched it to "live" so that under Approved Items on the Status & Review page in my App's settings in Facebook I now see email as a login permission that is approved. Thanks, |
Hi Kevin, Hey,FYI, FacebookOptions.Fields was added recently and is not part of RC1: a18181d. To use it, you need to migrate to the RC2 nightly builds.That said, you should be able to specify the fields directly in Options.UserInformationEndpoint (e.g Options.UserInformationEndpoint = "https://graph.facebook.com/me?fields=email,timezone,picture";).— |
Open project.json and change |
Hi Chris,
To: aspnet/Security Security@noreply.github.com Open project.json and change rc1-final to *— |
Yes you should change your sdk version to rc2-something, or just remove it and use the dnvm default. You'll need to use |
Hi all,
I'm using ASP.NET 5, MVC 6 RC1 (including Microsoft.AspNet.Authentication.Facebook). When I use the standard, built-in pages for account management, I noticed that when the user selects to authenticate with Facebook, the email field on the /Account/ExternalLoginCallback page is empty. I was just looking at FacebookOptions and there's a Fields property (and in the code there's a link to https://developers.facebook.com/docs/graph-api/reference/user). Anyways, I wanted to play around with adding "email" to my FacebookOptions object's Fields collection, but when I'm in Startup.cs and I declare a FacebookOptions object, it doesn't have a Fields property. When I right-click and go to definition I see this:
So why does the code in github have a Fields collection on the FacebookOptions object but I'm not seeing that in my application? I've verified my using statements and my project.json has
Thanks in advance,
Brian Eriksen
The text was updated successfully, but these errors were encountered: