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

Ways to set refresh token or extend expiration of ADAL token for long running operations #651

Open
jkotalik opened this issue Sep 1, 2021 · 1 comment

Comments

@jkotalik
Copy link

jkotalik commented Sep 1, 2021

Gah, I hate that pressing enter after entering a title automatically creates the issue πŸ˜΅β€πŸ’«

I'm currently using autorest with CLI auth for some long running operations, and occasionally, I see the following error:

Future#WaitForCompletion: the number of retries has been exceeded: StatusCode=401 -- Original Error: Code="ExpiredAuthenticationToken" Message="The access token expiry UTC time '5/25/2021 7:50:32 PM' is earlier than current UTC time '5/25/2021 7:54:13 PM'."

I'm currently calling NewAuthorizerFromCLIWithResource to obtain the Authorizer. From what I can tell, this:

  • Gets a CLI token by invoking az account get-access-token
  • Converts it to ADALToken
  • Returns a bearer authorizer wrapping the ADALToken.

When debugging this code, I noticed a few things:

  • The token returned from az account get-access-token will expire anywhere between 5 and 60 minutes.
  • The refresh token will be empty.
  • The ExpiresIn is hard coded to 60 minutes.

I'm trying to figure out ways to either extend the lifetime or refresh this token. Any suggestions?

@jkotalik jkotalik changed the title Ways to set refresh token or extend expiration of ADAL token for long running operations. Ways to set refresh token or extend expiration of ADAL token for long running operations Sep 1, 2021
@rajachennupati
Copy link

I am facing the same issue.
Are there any solution or update on this issue? any tips would be helpful

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

2 participants