-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
in: docsAn issue in Documentation or samplesAn issue in Documentation or samplesstatus: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchesstatus: ideal-for-contributionAn issue that we actively are looking for someone to help us withAn issue that we actively are looking for someone to help us withtype: bugA general bugA general bug
Milestone
Description
Spring Security 5.5.1
In each of the inner classes in the OAuth2AuthorizedClientProviderBuilder
(such as the PasswordGrantBuilder
) the comment on the use of the clockskew is
PasswordGrantBuilder.clockSkew()
"An access token is considered expired if it's before {@code Instant.now(this.clock) - clockSkew}."
However, the use of the clockskew in the PasswordOAuth2AuthorizedClientProvider
and other OAuth2AuthorizedClientProvider
implementations does not use the clock skew in this way and instead calculates if the token is expired using
PasswordOAuth2AuthorizedClientProvider.hasTokenExpired()
private boolean hasTokenExpired(OAuth2Token token) {
return this.clock.instant().isAfter(token.getExpiresAt().minus(this.clockSkew));
}
The calculation does not seem to be the correct use and should match the documentation and be
private boolean hasTokenExpired(OAuth2Token token) {
return token.getExpiresAt().isBefore(this.clock.instant().minus(this.clockSkew));
}
Metadata
Metadata
Assignees
Labels
in: docsAn issue in Documentation or samplesAn issue in Documentation or samplesstatus: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchesstatus: ideal-for-contributionAn issue that we actively are looking for someone to help us withAn issue that we actively are looking for someone to help us withtype: bugA general bugA general bug