I am using Asp.Net MVC OAuth login with facebook and google and strange thing that at some period it doesnot work
var externalIdentity =
HttpContext.GetOwinContext()
.Authentication.GetExternalIdentityAsync(DefaultAuthenticationTypes.ExternalCookie);
var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
if (loginInfo == null)
{
return RedirectToAction("Login");
}
Seems here it cant get user info and redirect to login page. I cant figure out why or what can cause that. I also have two slots beta and production.
So any suggestion or maybe somebody already have that and found way how to fix that?
Finally after few weeks i solve my problem. Its really something strange and probably issue is because of azure, since beforemy implementation works on VMvare for 6 month.
in AccountController there is method
add there
PS/ Firstly when I have seen this recommendation I did not understood how it can help but then next time when OAuth fails i just simply restarted WebApp and it starts working. By the way even now i dont understand what is going on with session but it works.