From 0f4ca191b290ae9b44c0a1116396a1be9722e40d Mon Sep 17 00:00:00 2001 From: lbw Date: Sat, 17 Jun 2023 18:49:10 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20Improving=20structure=20/=20format=20of?= =?UTF-8?q?=20the=20code.=20=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AuthorizationServerConfiguration.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/AuthorizationServerConfiguration.java b/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/AuthorizationServerConfiguration.java index d41ea5d9..a9c01e43 100755 --- a/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/AuthorizationServerConfiguration.java +++ b/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/AuthorizationServerConfiguration.java @@ -51,7 +51,7 @@ import java.util.Arrays; /** * @author lengleng * @date 2022/5/27 - * + *

* 认证服务器配置 */ @Configuration @@ -115,22 +115,17 @@ public class AuthorizationServerConfiguration { * @return DelegatingAuthenticationConverter */ private AuthenticationConverter accessTokenRequestConverter() { - return new DelegatingAuthenticationConverter(Arrays.asList( - new OAuth2ResourceOwnerPasswordAuthenticationConverter(), - new OAuth2ResourceOwnerSmsAuthenticationConverter(), - // OAuth2TokenEndpointFilter中构造的DelegatingAuthenticationConverter中已经创建了这三个,会重复调用 - // new OAuth2RefreshTokenAuthenticationConverter(), - // new OAuth2ClientCredentialsAuthenticationConverter(), - // new OAuth2AuthorizationCodeAuthenticationConverter(), - new OAuth2AuthorizationCodeRequestAuthenticationConverter())); + return new DelegatingAuthenticationConverter( + Arrays.asList(new OAuth2ResourceOwnerPasswordAuthenticationConverter(), + new OAuth2ResourceOwnerSmsAuthenticationConverter(), + new OAuth2AuthorizationCodeRequestAuthenticationConverter())); } /** * 注入授权模式实现提供方 - * + *

* 1. 密码模式
* 2. 短信登录
- * */ @SuppressWarnings("unchecked") private void addCustomOAuth2GrantAuthenticationProvider(HttpSecurity http) {