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

Update the authentication to use refresh_token for a more maintainable authentication experience #41

Open
serdardalgic opened this issue Nov 9, 2022 · 1 comment
Labels
enhancement New feature or request go Pull requests that update Go code

Comments

@serdardalgic
Copy link
Contributor

Right now, we're using API Token as Bearer token, more details here. API Token has to be renewed everyday.

We're able to get the refresh_token within the API token fetching process. This refresh token lives for 30 days, and can be used to refresh the auth token.

We can implement a mechanism that would use the refresh token instead of auth token (or both). The users would provide refresh token as a must, auth token as optional. When the auth token is expired, the refresh_token would be used to fetch a new auth token. If the refresh token doesn't work, the authentication fails.

@serdardalgic serdardalgic added enhancement New feature or request go Pull requests that update Go code labels Nov 9, 2022
@YanniHu1996
Copy link
Contributor

YanniHu1996 commented Nov 17, 2022

Hi @serdardalgic, I investigate this issue and found that it's difficult to make use of the way like getting access token to get refresh token. This is because the result of refresh flow is a new refresh token that must be stored for later use, referenced here. But terraform provider can't take advantage of state file to store new refresh token as refresh isn't a resource. So I think a possible solution is defining a new resource which contains at least access toekn and refresh token, and TF provider takes advantage of this resource to make authentication flow and stores gotten access token and refresh token.

Otherwise, we need to wait for BigAnimal team support a kind of long-term effective API key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request go Pull requests that update Go code
Projects
Development

No branches or pull requests

2 participants