Base solution for your next web application
Open Closed

Facebook Authentication not returning email #1313


User avatar
0
zedvance created

I enabled the google and facebook authentication and the google works fine, but the facebook throws an intenral server error. Further investigation shows that no email is returned, even though the permission is granted.

Searching on stackoverflow recommends workaround and installing Facebook SDK (<a class="postlink" href="http://stackoverflow.com/questions/20928939/how-to-get-facebook-first-and-last-name-values-using-asp-net-mvc-5-and-owin?lq=1">http://stackoverflow.com/questions/2092 ... -owin?lq=1</a>) Is there an alternative or recommended solution/workaround for ASPNET Zero


5 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    It seems related to facebook or your app settings on the facebook. For example, it's working for our demo and for our example projects (try it: <a class="postlink" href="http://eventcloud.aspnetboilerplate.com/">http://eventcloud.aspnetboilerplate.com/</a>). Maybe there is a setting you should enable on your facebook developer page. It's better to get support from comunity or directly from facebook, since we are using Microsoft.Owin.Security.Facebook package, which is faily common. Have a nice day.

  • User Avatar
    0
    zedvance created

    I followed the steps in this stackoverflow answer ([https://stackoverflow.com/questions/32059384/why-new-fb-api-2-4-returns-null-email-on-mvc-5-with-identity-and-oauth-2/32636149#32636149])) and it worked. Seems to affect version 2.4 and above of the Facebook API.

  • User Avatar
    0
    hikalkan created
    Support Team

    Thank you for your information sharing :)

  • User Avatar
    0
    rafalpiotrowski created

    from what I can see, eventcloud application also does not retrieve emailaddress!!!

    any solution for this issue?

    <cite>hikalkan: </cite> Hi,

    It seems related to facebook or your app settings on the facebook. For example, it's working for our demo and for our example projects (try it: <a class="postlink" href="http://eventcloud.aspnetboilerplate.com/">http://eventcloud.aspnetboilerplate.com/</a>). Maybe there is a setting you should enable on your facebook developer page. It's better to get support from comunity or directly from facebook, since we are using Microsoft.Owin.Security.Facebook package, which is faily common. Have a nice day.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I had a similar issue with twitter and I think Facebook has the same thing. It does not return user related data with first authentication requet.

    You need to make a second request to get user's information after authentication I think. You can try this <a class="postlink" href="http://stackoverflow.com/a/31715332/6681451">http://stackoverflow.com/a/31715332/6681451</a>.