I am trying to implement external logins with OWIN in an MVC5 application using a google account.
If Iโve already logged into Google, clicking the google button in my application is great, and it will lead me to my registration page after I have allowed me access to logininfo.
If I have not logged in to Google yet, when I click the Google Apps button for my applications, I will be prompted to log in to Google as expected, but the callback receiver does not seem to see that I'm logged in, since logininfo is always null in this script in the callback as shown below ...
[AllowAnonymous] public async Task<ActionResult> ExternalLoginCallback(string returnUrl) { var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(); if (loginInfo == null) { return RedirectToAction("Login"); }
Does anyone have a workaround or explanation? It is almost like an external cookie is not available for OWIN until the request after entering Google.
Hoots source share