Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No automatic refresh of authentication token #7

Open
janvda opened this issue Dec 4, 2019 · 3 comments
Open

No automatic refresh of authentication token #7

janvda opened this issue Dec 4, 2019 · 3 comments

Comments

@janvda
Copy link
Owner

janvda commented Dec 4, 2019

If the application is running more than 1 hour then the authentication expires and the application is not automatically refreshing it.

The following message is seen:

msg : error
"StatusCodeError: 401 - {"error":{"code":401,"message":"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED"}}"
@janvda
Copy link
Owner Author

janvda commented Dec 4, 2019

As workaround you can restart the node-red application as during startup the token becomes refreshed.

@janvda
Copy link
Owner Author

janvda commented Dec 8, 2019

see roopakv/google-photos#19

@janvda
Copy link
Owner Author

janvda commented Dec 8, 2019

Design proposal:

  1. Access and refresh token are stored in a file + expiry time of access token.
  2. Every 45 minutes tokens are refreshed using the refresh token. The refreshed tokens and new expiry time are stored to file (see point 1). If access token is updated then updated access token is stored. node.photos is deleted and reinitialized using new access token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant