-
Notifications
You must be signed in to change notification settings - Fork 127
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
How to get token refreshed #34
Comments
Hi @lizzha by default this client will use the oauth refresh tokens to get a new token automatically whenever a token has expired. This has the caveat of refresh tokens themselves actually having an expiry (something like a few days). In order to get a new token after that you would basically want to recreate the client to kick off the oauth process from the very start. |
Hi, we recently faced the same issue where the library failed to renew the refresh token. Best Michael |
We’d like to prevent an issue covered here on go-cfclient github project. [1] In order to do that, we’re implementing an extra while loop, that will wrap our existing logic and once it fails with a specific type of error, it should run the authentication once again. [1] cloudfoundry/go-cfclient#34
Is this an improvement that can be brought into this lib? |
When using username/password authentication the Client fetches a token on creation to be used as the token source. This token expires eventually and is only refreshable by creating a new Client object. Capture the expiration of the token and refresh the oauth client when it expires. fixes cloudfoundry#34 updates cloudfoundry-community/stackdriver-tools#177
* Respect expiration of password token source When using username/password authentication the Client fetches a token on creation to be used as the token source. This token expires eventually and is only refreshable by creating a new Client object. Capture the expiration of the token and refresh the oauth client when it expires. fixes #34 updates cloudfoundry-community/stackdriver-tools#177 * grab token expiration after successful fetch
* Respect expiration of password token source When using username/password authentication the Client fetches a token on creation to be used as the token source. This token expires eventually and is only refreshable by creating a new Client object. Capture the expiration of the token and refresh the oauth client when it expires. fixes cloudfoundry#34 updates cloudfoundry-community/stackdriver-tools#177 * grab token expiration after successful fetch
By default the token is valid for 10 minutes. How to get the token refreshed after it expires?
The text was updated successfully, but these errors were encountered: