This project has moved. For the latest updates, please go here.


Google Account OATH signin fails after some time.


I am cross posting my question from StackOverflow for better visibility.

I have followed the steps on MVC 5 App with Facebook, Twitter, LinkedIn and Google OAuth2 Sign-on for creating a Google OAuth external login.

However, periodically, my user's logins are not working. They have to log into their account with a password and remove, then re-add their external login for it to work again. However, it will fail again after a certain period of time.

Is there something this tutorial doesn't cover? Why are my Google logins expiring?

EDIT: I am not using refresh tokens. I am now asking for "offline" access. All I need is communication at time of the sign on.

It seems as if the following code is returning NULL for Google after some time.
 var loginInfo = await _authenticationManager.GetExternalLoginInfoAsync();
 if (loginInfo == null)
     return RedirectToAction("Login");
Closed Mar 2 at 10:45 PM by mgirgin
Looks like you figured this out on StackOverflow.