As per this answer: http://stackoverflow.com/questions/20378043/getting-the-email-from-external-providers-google-and-facebook-during-account-ass/20379623#20379623
I am trying to get the email from an external provider.
This is my code:
app.UseFacebookAuthentication(
appId: "X",
appSecret: "Y");
app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
{
ClientId = "X",
ClientSecret = "Y"
});
The ExternalLoginCallback method in account controller is still as default:
public async Task<ActionResult> ExternalLoginCallback(string returnUrl)
{
var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
At this point loginInfo is populated correctly apart from loginInfo.Email which is always null.
No matter the account provider they all authenticate but they all have a null email.
I have create a new MVC5 project from scratch with all nuget packages up to date and the latest VS2013 code.