🐛 Fixing a bug. 基础类型中的认证对象授权类型错误

This commit is contained in:
lbw 2024-01-26 13:28:04 +08:00
parent ff11c23712
commit 42ae56908a

View File

@ -147,14 +147,14 @@ public abstract class OAuth2ResourceOwnerBaseAuthenticationProvider<T extends OA
.principal(usernamePasswordAuthentication) .principal(usernamePasswordAuthentication)
.authorizationServerContext(AuthorizationServerContextHolder.getContext()) .authorizationServerContext(AuthorizationServerContextHolder.getContext())
.authorizedScopes(authorizedScopes) .authorizedScopes(authorizedScopes)
.authorizationGrantType(AuthorizationGrantType.PASSWORD) .authorizationGrantType(resouceOwnerBaseAuthentication.getAuthorizationGrantType())
.authorizationGrant(resouceOwnerBaseAuthentication); .authorizationGrant(resouceOwnerBaseAuthentication);
// @formatter:on // @formatter:on
OAuth2Authorization.Builder authorizationBuilder = OAuth2Authorization OAuth2Authorization.Builder authorizationBuilder = OAuth2Authorization
.withRegisteredClient(registeredClient) .withRegisteredClient(registeredClient)
.principalName(usernamePasswordAuthentication.getName()) .principalName(usernamePasswordAuthentication.getName())
.authorizationGrantType(AuthorizationGrantType.PASSWORD) .authorizationGrantType(resouceOwnerBaseAuthentication.getAuthorizationGrantType())
// 0.4.0 新增的方法 // 0.4.0 新增的方法
.authorizedScopes(authorizedScopes); .authorizedScopes(authorizedScopes);