http://www.asp.net/mvc/tutorials/mvc-4/using-oauth-providers-with-mvc
我正在使用本教程中的代码(当然,不是全部)。一切正常,但是当我尝试传递电子邮件时,我有System.Collections.Generic.KeyNotFoundException
. 为什么?如何从 Facebook 传递电子邮件值?
return View("ExternalLoginConfirmation", new RegisterExternalLoginModel {
UserName = result.UserName,
ExternalLoginData = loginData,
FullName = result.ExtraData["name"],
Email = result.ExtraData["email"],
ProfileLink = result.ExtraData["link"],
});
这有效:
return View("ExternalLoginConfirmation", new RegisterExternalLoginModel {
UserName = result.UserName,
ExternalLoginData = loginData,
FullName = result.ExtraData["name"],
//Email = result.ExtraData["email"],
ProfileLink = result.ExtraData["link"],
});
问候