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

Implemented a backoff mechanism for the AutoRefreshTokenCredential #19804

Merged
merged 15 commits into from
Jan 27, 2022
Merged

Implemented a backoff mechanism for the AutoRefreshTokenCredential #19804

merged 15 commits into from
Jan 27, 2022

Conversation

petrsvihlik
Copy link
Contributor

@petrsvihlik petrsvihlik commented Jan 12, 2022

Checklists

  • Added impacted package name to the issue description

Packages impacted by this PR:

Issues associated with this PR:

Describe the problem that is addressed by this PR:

  • If the token returned by token_refresher callback (implemented by Contoso) is soon to expire or expired, the AutoRefreshTokenCredential would keep looping constantly trying to fetch a new token.

  • We implemented a backoff mechanism for the case the token is soon-to-expire and throw an exception if the user fails to provide a non-expired token via the token_refresher.

What are the possible designs available to address the problem

If there are more than one possible design, why was the one in this PR chosen?

  • During the Azure Architecture Board SDK API review, it was decided to go this path since it's easier for

Does this PR needs any fixes in the SDK Generator? (If so, create an Issue in the Autorest/typescript repository and link it here)

  • No

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

  • Yes

Provide a list of related PRs(if any)

Command used to generate this PR:(Applicable only to SDK release request PRs)

  • N/A

@petrsvihlik

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@check-enforcer

This comment has been minimized.

@petrsvihlik

This comment has been minimized.

@petrsvihlik

This comment has been minimized.

1 similar comment
@petrsvihlik
Copy link
Contributor Author

/check-enforcer reset

@petrsvihlik
Copy link
Contributor Author

/azp run js - communication - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@petrsvihlik petrsvihlik merged commit d53738f into Azure:main Jan 27, 2022
@petrsvihlik petrsvihlik deleted the petrsvihlik/feature/autorefresh-backoff branch January 27, 2022 14:30
sadasant pushed a commit to sadasant/azure-sdk-for-js that referenced this pull request Jan 28, 2022
…zure#19804)

* initial backoff implementation

* added test for backoff

* improved the autorefresh documentation

* better explained scenarios

* clarify tokenRefresher's expected return type
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

Successfully merging this pull request may close these issues.

2 participants