fix #I4DKEM
This commit is contained in:
+3
-1
@@ -111,8 +111,9 @@ public class AuthUtils {
|
|||||||
* 获取登陆的帐户类型
|
* 获取登陆的帐户类型
|
||||||
*/
|
*/
|
||||||
public static String getAccountType(Authentication authentication) {
|
public static String getAccountType(Authentication authentication) {
|
||||||
Object details = authentication.getDetails();
|
|
||||||
String accountType = null;
|
String accountType = null;
|
||||||
|
if (authentication != null) {
|
||||||
|
Object details = authentication.getDetails();
|
||||||
if (details != null) {
|
if (details != null) {
|
||||||
if (details instanceof CustomWebAuthenticationDetails) {
|
if (details instanceof CustomWebAuthenticationDetails) {
|
||||||
CustomWebAuthenticationDetails detailsObj = (CustomWebAuthenticationDetails) details;
|
CustomWebAuthenticationDetails detailsObj = (CustomWebAuthenticationDetails) details;
|
||||||
@@ -124,6 +125,7 @@ public class AuthUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return accountType;
|
return accountType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.central.oauth.config;
|
package com.central.oauth.config;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.central.common.constant.SecurityConstants;
|
import com.central.common.constant.SecurityConstants;
|
||||||
import com.central.common.model.SysUser;
|
import com.central.common.model.SysUser;
|
||||||
import com.central.oauth.model.Client;
|
import com.central.oauth.model.Client;
|
||||||
@@ -120,7 +121,9 @@ public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdap
|
|||||||
Set<String> responseTypes = authentication.getOAuth2Request().getResponseTypes();
|
Set<String> responseTypes = authentication.getOAuth2Request().getResponseTypes();
|
||||||
Map<String, Object> additionalInfo = new HashMap<>(3);
|
Map<String, Object> additionalInfo = new HashMap<>(3);
|
||||||
String accountType = AuthUtils.getAccountType(authentication.getUserAuthentication());
|
String accountType = AuthUtils.getAccountType(authentication.getUserAuthentication());
|
||||||
|
if (StrUtil.isNotEmpty(accountType)) {
|
||||||
additionalInfo.put(SecurityConstants.ACCOUNT_TYPE_PARAM_NAME, accountType);
|
additionalInfo.put(SecurityConstants.ACCOUNT_TYPE_PARAM_NAME, accountType);
|
||||||
|
}
|
||||||
|
|
||||||
if (responseTypes.contains(SecurityConstants.ID_TOKEN)
|
if (responseTypes.contains(SecurityConstants.ID_TOKEN)
|
||||||
|| "authJwt".equals(tokenStoreProperties.getType())) {
|
|| "authJwt".equals(tokenStoreProperties.getType())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user