I'm working with the MirrorQuickStart project for .NET and am running into problems with the refresh token. From what I can tell, it is not being used when the "notify" action comes in for a timeline subscription update.
Publishing the app to a dev server, basically as-is with the exception of updating the proper IDs and config info, the "notify" action works within the first hour, but after that, it stops responding until I refresh the web page and re-authenticate.
I have checked the StoredCredentials table on the database server, and it has the UserId, AccessToken and RefreshToken values populated. I also created a new mirror service in the standard app flow (since I'm not sure how to debug the notify flow and see any actual error messages that are occuring) and each time, I see the AccessToken and RefreshToken on the service.
MirrorService service = new MirrorService(new BaseClientService.Initializer
{
Authenticator = Utils.GetAuthenticatorFromState(
Utils.GetStoredCredentials(userId))
});
I've reviewed the DrEdit project for Drive and the flow seems to be basically the same in terms of the GEtAuthenticatorFromState
and GetStoredCredentials
methods.
This question seemed to most directly relate to the problem I'm encountering, but the answer didn't make sense in terms of the mirror project.
How to generate access token using refresh token through Google Drive SDK in .NET?
There's gotta be something simple I'm missing - just not sure as I'm fairly new to the OAuth flow.
Thank you.