diff --git a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/base/OAuth2ResourceOwnerBaseAuthenticationProvider.java b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/base/OAuth2ResourceOwnerBaseAuthenticationProvider.java index 22044ec1c..5f1aa4680 100644 --- a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/base/OAuth2ResourceOwnerBaseAuthenticationProvider.java +++ b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/base/OAuth2ResourceOwnerBaseAuthenticationProvider.java @@ -147,14 +147,14 @@ public Authentication authenticate(Authentication authentication) throws Authent .principal(usernamePasswordAuthentication) .authorizationServerContext(AuthorizationServerContextHolder.getContext()) .authorizedScopes(authorizedScopes) - .authorizationGrantType(AuthorizationGrantType.PASSWORD) + .authorizationGrantType(resouceOwnerBaseAuthentication.getAuthorizationGrantType()) .authorizationGrant(resouceOwnerBaseAuthentication); // @formatter:on OAuth2Authorization.Builder authorizationBuilder = OAuth2Authorization .withRegisteredClient(registeredClient) .principalName(usernamePasswordAuthentication.getName()) - .authorizationGrantType(AuthorizationGrantType.PASSWORD) + .authorizationGrantType(resouceOwnerBaseAuthentication.getAuthorizationGrantType()) // 0.4.0 新增的方法 .authorizedScopes(authorizedScopes);