fix(credential-provider-sso): accept tokens till they expire #5124
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #4798
Description
Originally, the SDK decided to reject SSO tokens that were within 15 minutes of their expiry time as already expired, but the SSO refresh process only ran if there were 5 minutes left on the token. That means that if calls were made between 5 and 15 minutes of expiry, users would have to manually refresh the token.
The Java SDK decided to remedy this by removing that 15 minute check (aws/aws-sdk-java-v2#4157). This pull implements the same fix.
Testing
How was this change tested?
yarn test
in the changed package; all tests pass.Additional context
Add any other context about the PR here.
See also:
aws/aws-cdk#24782
aws/aws-sdk-js#4441
aws/aws-sdk#531
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.