Skip to content

Commit 7f294ab

Browse files
committed
Polish gh-376
1 parent 3ea7d8c commit 7f294ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AuthorizationCodeRequestAuthenticationProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ private Authentication authenticateAuthorizationRequest(Authentication authentic
232232
.build();
233233
}
234234

235-
OAuth2AuthorizationCode authorizationCode = createAuthorizationCode();
235+
OAuth2AuthorizationCode authorizationCode = generateAuthorizationCode();
236236
OAuth2Authorization authorization = authorizationBuilder(registeredClient, principal, authorizationRequest)
237237
.token(authorizationCode)
238238
.attribute(OAuth2Authorization.AUTHORIZED_SCOPE_ATTRIBUTE_NAME, authorizationRequest.getScopes())
@@ -268,7 +268,7 @@ private OAuth2AuthenticationValidator resolveAuthenticationValidator(String para
268268
DEFAULT_AUTHENTICATION_VALIDATOR_RESOLVER.apply(parameterName);
269269
}
270270

271-
private OAuth2AuthorizationCode createAuthorizationCode() {
271+
private OAuth2AuthorizationCode generateAuthorizationCode() {
272272
Instant issuedAt = Instant.now();
273273
Instant expiresAt = issuedAt.plus(5, ChronoUnit.MINUTES); // TODO Allow configuration for authorization code time-to-live
274274
return new OAuth2AuthorizationCode(this.authorizationCodeGenerator.get(), issuedAt, expiresAt);
@@ -345,7 +345,7 @@ private Authentication authenticateAuthorizationConsent(Authentication authentic
345345
this.authorizationConsentService.save(authorizationConsent);
346346
}
347347

348-
OAuth2AuthorizationCode authorizationCode = createAuthorizationCode();
348+
OAuth2AuthorizationCode authorizationCode = generateAuthorizationCode();
349349

350350
OAuth2Authorization updatedAuthorization = OAuth2Authorization.from(authorization)
351351
.token(authorizationCode)

0 commit comments

Comments
 (0)