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

[core, identity] examine our token refresh logic and code to ensure consistency with other languages #29608

Closed
jeremymeng opened this issue May 7, 2024 · 1 comment

Comments

@jeremymeng
Copy link
Contributor

We have a token cycler that handles access token refresh

.

There's also concern that under some condition, the while loop could potentially be running for a long time

while (token === null) {
await delay(retryIntervalInMs);
token = await tryGetAccessToken();
}

/cc @schaabs

xirzec added a commit that referenced this issue May 13, 2024
### Packages impacted by this PR

`core-rest-pipeline`
`ts-http-runtime`

### Issues associated with this PR

#29608

### Describe the problem that is addressed by this PR

When debugging a recent issue from Storage, it was reported that in the
case of the tokenCycler being unable to retrieve a new access token from
a CAE challenge, it would fall back to delaying for the maximum lifetime
of the current (invalid) access token instead of failing immediately.

This change improves the robustness of this scenario by invaliding the
existing cached token when claims are received.


### Are there test cases added in this PR? _(If not, why?)_

Yes, I added a test and confirmed it was timing out before the fix was
added.
@maorleger
Copy link
Member

Fixed via #29638

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

No branches or pull requests

3 participants