When i try to login with an external provider the first time this return null then i press again in the provider and everything is fine. I think is something with cookies because the error happen when i delete all cookies and try again.
If I remove all Session and TempData everything works OK, why is that?
public async Task<ActionResult> ExternalLoginCallback(string returnUrl)
{
var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
if (loginInfo == null)
{
Elmah.ErrorSignal.FromCurrentContext().Raise(new NotImplementedException("Error ExternalLoginCallback"));
TempData["_Error"] = "El incio de sesión con redes sociales no está disponible en este moemento, intente con su usuario y clave";
return RedirectToAction("Login");
}
}