From 2ffe3864d9bf913d792db57ff2c2a6e3451971a1 Mon Sep 17 00:00:00 2001 From: jumuning <840256574@qq.com> Date: Wed, 1 Jun 2022 13:40:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A9=E5=B1=95=E5=8C=85=E5=90=8D=E5=88=86?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pig/auth/config/AuthorizationServerConfiguration.java | 6 +++++- .../OAuth2ResourceOwnerPasswordAuthenticationConverter.java | 2 +- .../OAuth2ResourceOwnerPasswordAuthenticationProvider.java | 3 ++- .../OAuth2ResourceOwnerPasswordAuthenticationToken.java | 2 +- .../OAuth2ResourceOwnerSmsAuthenticationConverter.java | 2 +- .../OAuth2ResourceOwnerSmsAuthenticationProvider.java | 3 ++- .../OAuth2ResourceOwnerSmsAuthenticationToken.java | 2 +- 7 files changed, 13 insertions(+), 7 deletions(-) rename pig-auth/src/main/java/com/pig4cloud/pig/auth/support/{ => password}/OAuth2ResourceOwnerPasswordAuthenticationConverter.java (98%) rename pig-auth/src/main/java/com/pig4cloud/pig/auth/support/{ => password}/OAuth2ResourceOwnerPasswordAuthenticationProvider.java (99%) rename pig-auth/src/main/java/com/pig4cloud/pig/auth/support/{ => password}/OAuth2ResourceOwnerPasswordAuthenticationToken.java (98%) rename pig-auth/src/main/java/com/pig4cloud/pig/auth/support/{ => sms}/OAuth2ResourceOwnerSmsAuthenticationConverter.java (98%) rename pig-auth/src/main/java/com/pig4cloud/pig/auth/support/{ => sms}/OAuth2ResourceOwnerSmsAuthenticationProvider.java (99%) rename pig-auth/src/main/java/com/pig4cloud/pig/auth/support/{ => sms}/OAuth2ResourceOwnerSmsAuthenticationToken.java (98%) 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 67135e7e..a8914659 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 @@ -17,6 +17,10 @@ package com.pig4cloud.pig.auth.config; import com.pig4cloud.pig.auth.support.*; +import com.pig4cloud.pig.auth.support.password.OAuth2ResourceOwnerPasswordAuthenticationConverter; +import com.pig4cloud.pig.auth.support.password.OAuth2ResourceOwnerPasswordAuthenticationProvider; +import com.pig4cloud.pig.auth.support.sms.OAuth2ResourceOwnerSmsAuthenticationConverter; +import com.pig4cloud.pig.auth.support.sms.OAuth2ResourceOwnerSmsAuthenticationProvider; import com.pig4cloud.pig.common.core.constant.SecurityConstants; import com.pig4cloud.pig.common.security.component.PigDaoAuthenticationProvider; import com.pig4cloud.pig.common.security.service.PigUser; @@ -127,7 +131,7 @@ public class AuthorizationServerConfiguration { /** * 扩展密码模式 */ - @SuppressWarnings("all") + @SuppressWarnings("unchecked") private void addCustomOAuth2PasswordAuthenticationProvider(HttpSecurity http) { AuthenticationManager authenticationManager = http.getSharedObject(AuthenticationManager.class); diff --git a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerPasswordAuthenticationConverter.java b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/password/OAuth2ResourceOwnerPasswordAuthenticationConverter.java similarity index 98% rename from pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerPasswordAuthenticationConverter.java rename to pig-auth/src/main/java/com/pig4cloud/pig/auth/support/password/OAuth2ResourceOwnerPasswordAuthenticationConverter.java index 707dd62d..ea243cfc 100644 --- a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerPasswordAuthenticationConverter.java +++ b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/password/OAuth2ResourceOwnerPasswordAuthenticationConverter.java @@ -1,4 +1,4 @@ -package com.pig4cloud.pig.auth.support; +package com.pig4cloud.pig.auth.support.password; import com.pig4cloud.pig.common.core.constant.SecurityConstants; import com.pig4cloud.pig.common.security.util.OAuth2EndpointUtils; diff --git a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerPasswordAuthenticationProvider.java b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/password/OAuth2ResourceOwnerPasswordAuthenticationProvider.java similarity index 99% rename from pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerPasswordAuthenticationProvider.java rename to pig-auth/src/main/java/com/pig4cloud/pig/auth/support/password/OAuth2ResourceOwnerPasswordAuthenticationProvider.java index c52243bf..ca53f80a 100644 --- a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerPasswordAuthenticationProvider.java +++ b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/password/OAuth2ResourceOwnerPasswordAuthenticationProvider.java @@ -1,5 +1,6 @@ -package com.pig4cloud.pig.auth.support; +package com.pig4cloud.pig.auth.support.password; +import com.pig4cloud.pig.auth.support.ScopeException; import com.pig4cloud.pig.common.security.util.OAuth2ErrorCodesExpand; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerPasswordAuthenticationToken.java b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/password/OAuth2ResourceOwnerPasswordAuthenticationToken.java similarity index 98% rename from pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerPasswordAuthenticationToken.java rename to pig-auth/src/main/java/com/pig4cloud/pig/auth/support/password/OAuth2ResourceOwnerPasswordAuthenticationToken.java index ba03ef6a..21a00625 100644 --- a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerPasswordAuthenticationToken.java +++ b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/password/OAuth2ResourceOwnerPasswordAuthenticationToken.java @@ -1,4 +1,4 @@ -package com.pig4cloud.pig.auth.support; +package com.pig4cloud.pig.auth.support.password; import org.springframework.lang.Nullable; import org.springframework.security.authentication.AbstractAuthenticationToken; diff --git a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerSmsAuthenticationConverter.java b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/sms/OAuth2ResourceOwnerSmsAuthenticationConverter.java similarity index 98% rename from pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerSmsAuthenticationConverter.java rename to pig-auth/src/main/java/com/pig4cloud/pig/auth/support/sms/OAuth2ResourceOwnerSmsAuthenticationConverter.java index 7a851810..37f51bf9 100644 --- a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerSmsAuthenticationConverter.java +++ b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/sms/OAuth2ResourceOwnerSmsAuthenticationConverter.java @@ -1,4 +1,4 @@ -package com.pig4cloud.pig.auth.support; +package com.pig4cloud.pig.auth.support.sms; import com.pig4cloud.pig.common.core.constant.SecurityConstants; import com.pig4cloud.pig.common.security.util.OAuth2EndpointUtils; diff --git a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerSmsAuthenticationProvider.java b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/sms/OAuth2ResourceOwnerSmsAuthenticationProvider.java similarity index 99% rename from pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerSmsAuthenticationProvider.java rename to pig-auth/src/main/java/com/pig4cloud/pig/auth/support/sms/OAuth2ResourceOwnerSmsAuthenticationProvider.java index 1e751cac..23130e79 100644 --- a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerSmsAuthenticationProvider.java +++ b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/sms/OAuth2ResourceOwnerSmsAuthenticationProvider.java @@ -1,5 +1,6 @@ -package com.pig4cloud.pig.auth.support; +package com.pig4cloud.pig.auth.support.sms; +import com.pig4cloud.pig.auth.support.ScopeException; import com.pig4cloud.pig.common.core.constant.SecurityConstants; import com.pig4cloud.pig.common.security.util.OAuth2ErrorCodesExpand; import org.apache.logging.log4j.LogManager; diff --git a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerSmsAuthenticationToken.java b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/sms/OAuth2ResourceOwnerSmsAuthenticationToken.java similarity index 98% rename from pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerSmsAuthenticationToken.java rename to pig-auth/src/main/java/com/pig4cloud/pig/auth/support/sms/OAuth2ResourceOwnerSmsAuthenticationToken.java index 91687057..96742af3 100644 --- a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/OAuth2ResourceOwnerSmsAuthenticationToken.java +++ b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/sms/OAuth2ResourceOwnerSmsAuthenticationToken.java @@ -1,4 +1,4 @@ -package com.pig4cloud.pig.auth.support; +package com.pig4cloud.pig.auth.support.sms; import org.springframework.lang.Nullable; import org.springframework.security.authentication.AbstractAuthenticationToken;