Polish gh-786

This commit is contained in:
Joe Grandja
2022-07-19 12:27:43 -04:00
parent 303043ea78
commit 19c7606c52
2 changed files with 3 additions and 5 deletions

View File

@@ -564,10 +564,8 @@ public final class OAuth2AuthorizationCodeRequestAuthenticationProvider implemen
!OAuth2ParameterNames.CODE.equals(context.getTokenType().getValue())) {
return null;
}
RegisteredClient registeredClient = context.getRegisteredClient();
Instant issuedAt = Instant.now();
Instant expiresAt = issuedAt.plus(registeredClient.getTokenSettings().getAuthorizationCodeTimeToLive());
Instant expiresAt = issuedAt.plus(context.getRegisteredClient().getTokenSettings().getAuthorizationCodeTimeToLive());
return new OAuth2AuthorizationCode(this.authorizationCodeGenerator.generateKey(), issuedAt, expiresAt);
}

View File

@@ -129,8 +129,8 @@ public final class TokenSettings extends AbstractSettings {
}
/**
* Set the time-to-live for an access token. Must be greater than {@code Duration.ZERO}.
* A maximum authorization code lifetime of 10 minutes is RECOMMENDED
* Set the time-to-live for an authorization code. Must be greater than {@code Duration.ZERO}.
* A maximum authorization code lifetime of 10 minutes is RECOMMENDED.
*
* @param authorizationCodeTimeToLive the time-to-live for an authorization code
* @return the {@link Builder} for further configuration