mirror of https://gitee.com/topiam/eiam
				
				
				
			⚡ 优化代码
							parent
							
								
									5cb334a502
								
							
						
					
					
						commit
						46c3dba060
					
				| 
						 | 
				
			
			@ -72,7 +72,7 @@ import static cn.topiam.employee.common.enums.IdentityProviderType.DINGTALK_OAUT
 | 
			
		|||
 */
 | 
			
		||||
@SuppressWarnings("DuplicatedCode")
 | 
			
		||||
public class DingtalkOauthAuthenticationFilter extends AbstractIdpAuthenticationProcessingFilter {
 | 
			
		||||
    public final static String                DEFAULT_FILTER_PROCESSES_URI = DINGTALK_OAUTH
 | 
			
		||||
    public static final String                DEFAULT_FILTER_PROCESSES_URI = DINGTALK_OAUTH
 | 
			
		||||
        .getLoginPathPrefix() + "/*";
 | 
			
		||||
    /**
 | 
			
		||||
     * AntPathRequestMatcher
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -65,7 +65,9 @@ import cn.topiam.employee.core.context.ServerContextHelp;
 | 
			
		|||
import cn.topiam.employee.support.exception.TopIamException;
 | 
			
		||||
import cn.topiam.employee.support.trace.TraceUtils;
 | 
			
		||||
import cn.topiam.employee.support.util.HttpUrlUtils;
 | 
			
		||||
import static cn.topiam.employee.authentication.dingtalk.constant.DingTalkAuthenticationConstants.*;
 | 
			
		||||
import static cn.topiam.employee.authentication.dingtalk.constant.DingTalkAuthenticationConstants.GET_USERINFO_BY_CODE;
 | 
			
		||||
import static cn.topiam.employee.authentication.dingtalk.constant.DingTalkAuthenticationConstants.GET_USERINFO_BY_USERID;
 | 
			
		||||
import static cn.topiam.employee.authentication.dingtalk.constant.DingTalkAuthenticationConstants.GET_USERID_BY_UNIONID;
 | 
			
		||||
import static cn.topiam.employee.authentication.dingtalk.filter.DingtalkScanCodeAuthorizationRequestGetFilter.PROVIDER_ID;
 | 
			
		||||
import static cn.topiam.employee.common.enums.IdentityProviderType.DINGTALK_SCAN_CODE;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -80,7 +82,7 @@ import static cn.topiam.employee.common.enums.IdentityProviderType.DINGTALK_SCAN
 | 
			
		|||
@SuppressWarnings("DuplicatedCode")
 | 
			
		||||
public class DingtalkScanCodeAuthenticationFilter extends
 | 
			
		||||
                                                  AbstractIdpAuthenticationProcessingFilter {
 | 
			
		||||
    public final static String                DEFAULT_FILTER_PROCESSES_URI = DINGTALK_SCAN_CODE
 | 
			
		||||
    public static final String                DEFAULT_FILTER_PROCESSES_URI = DINGTALK_SCAN_CODE
 | 
			
		||||
        .getLoginPathPrefix() + "/*";
 | 
			
		||||
    /**
 | 
			
		||||
     * AntPathRequestMatcher
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -67,7 +67,7 @@ import static cn.topiam.employee.portal.idp.qq.constant.QqAuthenticationConstant
 | 
			
		|||
@SuppressWarnings({ "AlibabaClassNamingShouldBeCamel", "DuplicatedCode" })
 | 
			
		||||
public class QqOAuth2LoginAuthenticationFilter extends AbstractIdpAuthenticationProcessingFilter {
 | 
			
		||||
    final String                              ERROR_CODE                   = "error";
 | 
			
		||||
    public final static String                DEFAULT_FILTER_PROCESSES_URI = QQ.getLoginPathPrefix()
 | 
			
		||||
    public static final String                DEFAULT_FILTER_PROCESSES_URI = QQ.getLoginPathPrefix()
 | 
			
		||||
                                                                             + "/*";
 | 
			
		||||
    public static final AntPathRequestMatcher REQUEST_MATCHER              = new AntPathRequestMatcher(
 | 
			
		||||
        QQ.getLoginPathPrefix() + "/" + "{" + PROVIDER_ID + "}", HttpMethod.GET.name());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -59,7 +59,7 @@ public class SmsAuthenticationFilter extends AbstractAuthenticationProcessingFil
 | 
			
		|||
     */
 | 
			
		||||
    private boolean                    postOnly                     = true;
 | 
			
		||||
 | 
			
		||||
    public final static String         DEFAULT_FILTER_PROCESSES_URI = SMS_LOGIN;
 | 
			
		||||
    public static final String         DEFAULT_FILTER_PROCESSES_URI = SMS_LOGIN;
 | 
			
		||||
 | 
			
		||||
    public static final RequestMatcher SMS_LOGIN_MATCHER            = new AntPathRequestMatcher(
 | 
			
		||||
        DEFAULT_FILTER_PROCESSES_URI, HttpMethod.POST.name());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -51,7 +51,10 @@ import com.google.common.collect.Sets;
 | 
			
		|||
import cn.topiam.employee.authentication.wechat.WeChatIdpScanCodeConfig;
 | 
			
		||||
import cn.topiam.employee.common.entity.authentication.IdentityProviderEntity;
 | 
			
		||||
import cn.topiam.employee.common.repository.authentication.IdentityProviderRepository;
 | 
			
		||||
import static cn.topiam.employee.authentication.wechat.constant.WeChatAuthenticationConstants.*;
 | 
			
		||||
import static cn.topiam.employee.authentication.wechat.constant.WeChatAuthenticationConstants.APP_ID;
 | 
			
		||||
import static cn.topiam.employee.authentication.wechat.constant.WeChatAuthenticationConstants.AUTHORIZATION_REQUEST;
 | 
			
		||||
import static cn.topiam.employee.authentication.wechat.constant.WeChatAuthenticationConstants.HREF;
 | 
			
		||||
import static cn.topiam.employee.authentication.wechat.constant.WeChatAuthenticationConstants.SNSAPI_LOGIN;
 | 
			
		||||
import static cn.topiam.employee.common.enums.IdentityProviderType.WECHAT_SCAN_CODE;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
| 
						 | 
				
			
			@ -160,13 +163,13 @@ public class WeChatScanCodeAuthorizationRequestRedirectFilter extends OncePerReq
 | 
			
		|||
            authorizationRequest.getAuthorizationRequestUri());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private final static String STYLE        = ""
 | 
			
		||||
    private static final String STYLE        = ""
 | 
			
		||||
                                               + ".impowerBox .qrcode {width: 280px;border: none;margin-top:10px;}\n"
 | 
			
		||||
                                               + ".impowerBox .title {display: none;}\n"
 | 
			
		||||
                                               + ".impowerBox .info {display: none;}\n"
 | 
			
		||||
                                               + ".status_icon {display: none}\n"
 | 
			
		||||
                                               + ".impowerBox .status {text-align: center;} ";
 | 
			
		||||
    private final static String STYLE_BASE64 = "data:text/css;base64," + Base64.getEncoder()
 | 
			
		||||
    private static final String STYLE_BASE64 = "data:text/css;base64," + Base64.getEncoder()
 | 
			
		||||
        .encodeToString(STYLE.getBytes(StandardCharsets.UTF_8));
 | 
			
		||||
 | 
			
		||||
    public static RequestMatcher getRequestMatcher() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,7 +44,6 @@ import cn.topiam.employee.authentication.common.filter.AbstractIdpAuthentication
 | 
			
		|||
import cn.topiam.employee.authentication.common.modal.IdpUser;
 | 
			
		||||
import cn.topiam.employee.authentication.common.service.UserIdpService;
 | 
			
		||||
import cn.topiam.employee.authentication.wechat.WeChatIdpScanCodeConfig;
 | 
			
		||||
import cn.topiam.employee.authentication.wechat.constant.WeChatAuthenticationConstants;
 | 
			
		||||
import cn.topiam.employee.common.entity.authentication.IdentityProviderEntity;
 | 
			
		||||
import cn.topiam.employee.common.enums.IdentityProviderType;
 | 
			
		||||
import cn.topiam.employee.common.repository.authentication.IdentityProviderRepository;
 | 
			
		||||
| 
						 | 
				
			
			@ -53,7 +52,11 @@ import cn.topiam.employee.support.exception.TopIamException;
 | 
			
		|||
import cn.topiam.employee.support.util.HttpClientUtils;
 | 
			
		||||
import static org.springframework.security.oauth2.core.AuthorizationGrantType.AUTHORIZATION_CODE;
 | 
			
		||||
 | 
			
		||||
import static cn.topiam.employee.authentication.wechat.constant.WeChatAuthenticationConstants.*;
 | 
			
		||||
import static cn.topiam.employee.authentication.wechat.constant.WeChatAuthenticationConstants.ACCESS_TOKEN;
 | 
			
		||||
import static cn.topiam.employee.authentication.wechat.constant.WeChatAuthenticationConstants.APP_ID;
 | 
			
		||||
import static cn.topiam.employee.authentication.wechat.constant.WeChatAuthenticationConstants.ERROR_CODE;
 | 
			
		||||
import static cn.topiam.employee.authentication.wechat.constant.WeChatAuthenticationConstants.SECRET;
 | 
			
		||||
import static cn.topiam.employee.authentication.wechat.constant.WeChatAuthenticationConstants.USER_INFO;
 | 
			
		||||
import static cn.topiam.employee.authentication.wechat.filter.WeChatScanCodeAuthorizationRequestRedirectFilter.PROVIDER_ID;
 | 
			
		||||
import static cn.topiam.employee.common.enums.IdentityProviderType.WECHAT_SCAN_CODE;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -66,7 +69,7 @@ import static cn.topiam.employee.common.enums.IdentityProviderType.WECHAT_SCAN_C
 | 
			
		|||
public class WeChatScanCodeLoginAuthenticationFilter extends
 | 
			
		||||
                                                     AbstractIdpAuthenticationProcessingFilter {
 | 
			
		||||
 | 
			
		||||
    public final static String                DEFAULT_FILTER_PROCESSES_URI = WECHAT_SCAN_CODE
 | 
			
		||||
    public static final String                DEFAULT_FILTER_PROCESSES_URI = WECHAT_SCAN_CODE
 | 
			
		||||
        .getLoginPathPrefix() + "/*";
 | 
			
		||||
    public static final AntPathRequestMatcher REQUEST_MATCHER              = new AntPathRequestMatcher(
 | 
			
		||||
        WECHAT_SCAN_CODE.getLoginPathPrefix() + "/" + "{" + PROVIDER_ID + "}",
 | 
			
		||||
| 
						 | 
				
			
			@ -133,8 +136,7 @@ public class WeChatScanCodeLoginAuthenticationFilter extends
 | 
			
		|||
        param.put(SECRET, config.getAppSecret());
 | 
			
		||||
        param.put(OAuth2ParameterNames.CODE, code);
 | 
			
		||||
        param.put(OAuth2ParameterNames.GRANT_TYPE, AUTHORIZATION_CODE.getValue());
 | 
			
		||||
        JSONObject result = JSON
 | 
			
		||||
            .parseObject(HttpClientUtils.get(WeChatAuthenticationConstants.ACCESS_TOKEN, param));
 | 
			
		||||
        JSONObject result = JSON.parseObject(HttpClientUtils.get(ACCESS_TOKEN, param));
 | 
			
		||||
        if (result.containsKey(ERROR_CODE)) {
 | 
			
		||||
            logger.error("获取access_token发生错误:  " + result.toJSONString());
 | 
			
		||||
            throw new TopIamException("获取access_token发生错误:  " + result.toJSONString());
 | 
			
		||||
| 
						 | 
				
			
			@ -144,8 +146,7 @@ public class WeChatScanCodeLoginAuthenticationFilter extends
 | 
			
		|||
        param.put(OAuth2ParameterNames.ACCESS_TOKEN,
 | 
			
		||||
            result.getString(OAuth2ParameterNames.ACCESS_TOKEN));
 | 
			
		||||
        param.put(OidcScopes.OPENID, result.getString(OidcScopes.OPENID));
 | 
			
		||||
        result = JSON
 | 
			
		||||
            .parseObject(HttpClientUtils.get(WeChatAuthenticationConstants.USER_INFO, param));
 | 
			
		||||
        result = JSON.parseObject(HttpClientUtils.get(USER_INFO, param));
 | 
			
		||||
        if (result.containsKey(ERROR_CODE)) {
 | 
			
		||||
            logger.error("获取微信用户个人信息发生错误:  " + result.toJSONString());
 | 
			
		||||
            throw new TopIamException("获取微信用户个人信息发生错误:  " + result.toJSONString());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,14 +24,14 @@ package cn.topiam.employee.authentication.wechatwork.constant;
 | 
			
		|||
 * Created by support@topiam.cn on  2021/12/9 22:19
 | 
			
		||||
 */
 | 
			
		||||
public final class WeChatWorkAuthenticationConstants {
 | 
			
		||||
    public final static String APP_ID        = "appid";
 | 
			
		||||
    public final static String AGENT_ID      = "agentid";
 | 
			
		||||
    public final static String HREF          = "href";
 | 
			
		||||
    public final static String LOGIN_TYPE    = "login_type";
 | 
			
		||||
    public final static String JSSDK         = "jssdk";
 | 
			
		||||
    public final static String URL_AUTHORIZE = "https://open.work.weixin.qq.com/wwopen/sso/v1/qrConnect";
 | 
			
		||||
    public static final String APP_ID        = "appid";
 | 
			
		||||
    public static final String AGENT_ID      = "agentid";
 | 
			
		||||
    public static final String HREF          = "href";
 | 
			
		||||
    public static final String LOGIN_TYPE    = "login_type";
 | 
			
		||||
    public static final String JSSDK         = "jssdk";
 | 
			
		||||
    public static final String URL_AUTHORIZE = "https://open.work.weixin.qq.com/wwopen/sso/v1/qrConnect";
 | 
			
		||||
 | 
			
		||||
    public final static String GET_USER_INFO = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo";
 | 
			
		||||
    public static final String GET_USER_INFO = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo";
 | 
			
		||||
 | 
			
		||||
    public final static String GET_TOKEN     = "https://qyapi.weixin.qq.com/cgi-bin/gettoken";
 | 
			
		||||
    public static final String GET_TOKEN     = "https://qyapi.weixin.qq.com/cgi-bin/gettoken";
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -149,13 +149,13 @@ public class WeChatWorkScanCodeAuthorizationRequestRedirectFilter extends OncePe
 | 
			
		|||
            authorizationRequest.getAuthorizationRequestUri());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private final static String STYLE        = ""
 | 
			
		||||
    private static final String STYLE        = ""
 | 
			
		||||
                                               + ".impowerBox .qrcode {width: 280px;border: none;margin-top:10px;}\n"
 | 
			
		||||
                                               + ".impowerBox .title {display: none;}\n"
 | 
			
		||||
                                               + ".impowerBox .info {display: none;}\n"
 | 
			
		||||
                                               + ".status_icon {display: none}\n"
 | 
			
		||||
                                               + ".impowerBox .status {text-align: center;} ";
 | 
			
		||||
    private final static String STYLE_BASE64 = "data:text/css;base64," + Base64.getEncoder()
 | 
			
		||||
    private static final String STYLE_BASE64 = "data:text/css;base64," + Base64.getEncoder()
 | 
			
		||||
        .encodeToString(STYLE.getBytes(StandardCharsets.UTF_8));
 | 
			
		||||
 | 
			
		||||
    public static RequestMatcher getRequestMatcher() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -67,7 +67,7 @@ public class WeChatWorkScanCodeLoginAuthenticationFilter extends
 | 
			
		|||
                                                         AbstractIdpAuthenticationProcessingFilter {
 | 
			
		||||
    final String                              ERROR_CODE                   = "errcode";
 | 
			
		||||
    final String                              SUCCESS                      = "0";
 | 
			
		||||
    public final static String                DEFAULT_FILTER_PROCESSES_URI = WECHATWORK_SCAN_CODE
 | 
			
		||||
    public static final String                DEFAULT_FILTER_PROCESSES_URI = WECHATWORK_SCAN_CODE
 | 
			
		||||
        .getLoginPathPrefix() + "/*";
 | 
			
		||||
    public static final AntPathRequestMatcher REQUEST_MATCHER              = new AntPathRequestMatcher(
 | 
			
		||||
        WECHATWORK_SCAN_CODE.getLoginPathPrefix() + "/" + "{" + PROVIDER_ID + "}",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,19 +30,19 @@ public final class AccountConstants {
 | 
			
		|||
    /**
 | 
			
		||||
     * 用户API
 | 
			
		||||
     */
 | 
			
		||||
    public final static String   USER_PATH                  = API_PATH + "/user";
 | 
			
		||||
    public static final String   USER_PATH                  = API_PATH + "/user";
 | 
			
		||||
    /**
 | 
			
		||||
     * 组织机构API
 | 
			
		||||
     */
 | 
			
		||||
    public final static String   ORGANIZATION_PATH          = API_PATH + "/organization";
 | 
			
		||||
    public static final String   ORGANIZATION_PATH          = API_PATH + "/organization";
 | 
			
		||||
    /**
 | 
			
		||||
     * 用户组API
 | 
			
		||||
     */
 | 
			
		||||
    public final static String   USER_GROUP_PATH            = API_PATH + "/user_group";
 | 
			
		||||
    public static final String   USER_GROUP_PATH            = API_PATH + "/user_group";
 | 
			
		||||
    /**
 | 
			
		||||
     * 身份源API
 | 
			
		||||
     */
 | 
			
		||||
    public final static String   IDENTITY_SOURCE_PATH       = API_PATH + "/identity_source";
 | 
			
		||||
    public static final String   IDENTITY_SOURCE_PATH       = API_PATH + "/identity_source";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 组名称
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,7 +30,7 @@ public final class AnalysisConstants {
 | 
			
		|||
    /**
 | 
			
		||||
     * 统计分析API路径
 | 
			
		||||
     */
 | 
			
		||||
    public final static String ANALYSIS_PATH       = API_PATH + "/analysis";
 | 
			
		||||
    public static final String ANALYSIS_PATH       = API_PATH + "/analysis";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 组名称
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,7 +31,7 @@ public final class AppConstants {
 | 
			
		|||
    /**
 | 
			
		||||
     * 应用管理API路径
 | 
			
		||||
     */
 | 
			
		||||
    public final static String APP_PATH              = API_PATH + "/app";
 | 
			
		||||
    public static final String APP_PATH              = API_PATH + "/app";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 组名称
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,7 +29,7 @@ public final class AuditConstants {
 | 
			
		|||
    /**
 | 
			
		||||
     * 系统审计API路径
 | 
			
		||||
     */
 | 
			
		||||
    public final static String  AUDIT_PATH         = API_PATH + "/audit";
 | 
			
		||||
    public static final String  AUDIT_PATH         = API_PATH + "/audit";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 组名称
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -26,7 +26,7 @@ import cn.topiam.employee.support.constant.EiamConstants;
 | 
			
		|||
 * Created by support@topiam.cn on 2020/7/26 19:07
 | 
			
		||||
 */
 | 
			
		||||
public final class AuthenticationConstants {
 | 
			
		||||
    public final static String AUTHENTICATION_PATH       = EiamConstants.API_PATH
 | 
			
		||||
    public static final String AUTHENTICATION_PATH       = EiamConstants.API_PATH
 | 
			
		||||
                                                           + "/authentication";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,7 +30,7 @@ public final class AuthorizeConstants {
 | 
			
		|||
     * LOGIN
 | 
			
		||||
     */
 | 
			
		||||
    public static final String LOGIN_PATH                = EiamConstants.API_PATH + "/login";
 | 
			
		||||
    public final static String AUTHORIZE_PATH            = EiamConstants.API_PATH + "/authorize";
 | 
			
		||||
    public static final String AUTHORIZE_PATH            = EiamConstants.API_PATH + "/authorize";
 | 
			
		||||
    public static final String AUTHORIZATION_REQUEST_URI = EiamConstants.API_PATH
 | 
			
		||||
                                                           + "/authorization";
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -73,11 +73,11 @@ public final class ProtocolConstants {
 | 
			
		|||
        /**
 | 
			
		||||
         * OIDC BASE 认证路径
 | 
			
		||||
         */
 | 
			
		||||
        public final static String OIDC_AUTHORIZE_BASE_PATH = AUTHORIZE_PATH + "/" + APP_CODE_VARIABLE;
 | 
			
		||||
        public static final String OIDC_AUTHORIZE_BASE_PATH = AUTHORIZE_PATH + "/" + APP_CODE_VARIABLE;
 | 
			
		||||
 | 
			
		||||
        public final static String OIDC_AUTHORIZE_PATH = OIDC_AUTHORIZE_BASE_PATH + "/oidc";
 | 
			
		||||
        public static final String OIDC_AUTHORIZE_PATH = OIDC_AUTHORIZE_BASE_PATH + "/oidc";
 | 
			
		||||
 | 
			
		||||
        public final static String OAUTH2_AUTHORIZE_PATH = OIDC_AUTHORIZE_BASE_PATH + "/oauth2";
 | 
			
		||||
        public static final String OAUTH2_AUTHORIZE_PATH = OIDC_AUTHORIZE_BASE_PATH + "/oauth2";
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * OpenID Provider metadata.
 | 
			
		||||
| 
						 | 
				
			
			@ -130,7 +130,7 @@ public final class ProtocolConstants {
 | 
			
		|||
        /**
 | 
			
		||||
         * SAML2  认证路径
 | 
			
		||||
         */
 | 
			
		||||
        public final static String SAML2_AUTHORIZE_BASE_PATH = AUTHORIZE_PATH + "/saml2/"
 | 
			
		||||
        public static final String SAML2_AUTHORIZE_BASE_PATH = AUTHORIZE_PATH + "/saml2/"
 | 
			
		||||
                                                               + APP_CODE_VARIABLE;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
| 
						 | 
				
			
			@ -154,21 +154,21 @@ public final class ProtocolConstants {
 | 
			
		|||
        /**
 | 
			
		||||
         * cas  根路径
 | 
			
		||||
         */
 | 
			
		||||
        public final static String CAS_AUTHORIZE_BASE_PATH = AUTHORIZE_PATH + "/cas/"
 | 
			
		||||
        public static final String CAS_AUTHORIZE_BASE_PATH = AUTHORIZE_PATH + "/cas/"
 | 
			
		||||
                                                             + APP_CODE_VARIABLE;
 | 
			
		||||
        /**
 | 
			
		||||
         * cas 登陆地址
 | 
			
		||||
         */
 | 
			
		||||
        public final static String CAS_LOGIN_PATH          = CAS_AUTHORIZE_BASE_PATH + "/login";
 | 
			
		||||
        /**
 | 
			
		||||
        public static final String CAS_LOGIN_PATH          = CAS_AUTHORIZE_BASE_PATH + "/login";
 | 
			
		||||
        /*
 | 
			
		||||
         * cas ticket校验地址
 | 
			
		||||
         */
 | 
			
		||||
        public final static String CAS_VALIDATE_V1_PATH    = CAS_AUTHORIZE_BASE_PATH + "/validate";
 | 
			
		||||
        public static final String CAS_VALIDATE_V1_PATH    = CAS_AUTHORIZE_BASE_PATH + "/validate";
 | 
			
		||||
 | 
			
		||||
        public final static String CAS_VALIDATE_V2_PATH    = CAS_AUTHORIZE_BASE_PATH
 | 
			
		||||
        public static final String CAS_VALIDATE_V2_PATH    = CAS_AUTHORIZE_BASE_PATH
 | 
			
		||||
                                                             + "/serviceValidate";
 | 
			
		||||
 | 
			
		||||
        public final static String CAS_VALIDATE_V3_PATH    = CAS_AUTHORIZE_BASE_PATH
 | 
			
		||||
        public static final String CAS_VALIDATE_V3_PATH    = CAS_AUTHORIZE_BASE_PATH
 | 
			
		||||
                                                             + "/p3/serviceValidate";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -26,7 +26,7 @@ import cn.topiam.employee.support.constant.EiamConstants;
 | 
			
		|||
 * Created by support@topiam.cn on  2022/6/8 20:12
 | 
			
		||||
 */
 | 
			
		||||
public final class SessionConstants {
 | 
			
		||||
    public final static String SESSION_PATH   = EiamConstants.API_PATH + "/session";
 | 
			
		||||
    public static final String SESSION_PATH   = EiamConstants.API_PATH + "/session";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * CURRENT_USER
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,7 +31,7 @@ public final class SettingConstants {
 | 
			
		|||
    /**
 | 
			
		||||
     * 系统设置API路径
 | 
			
		||||
     */
 | 
			
		||||
    public final static String SETTING_PATH       = EiamConstants.API_PATH + "/setting";
 | 
			
		||||
    public static final String SETTING_PATH       = EiamConstants.API_PATH + "/setting";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 组名称
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,7 +29,7 @@ public final class StorageConstants {
 | 
			
		|||
    /**
 | 
			
		||||
     * 存储API路径
 | 
			
		||||
     */
 | 
			
		||||
    public final static String STORAGE_PATH       = EiamConstants.API_PATH + "/storage";
 | 
			
		||||
    public static final String STORAGE_PATH       = EiamConstants.API_PATH + "/storage";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件存储
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -68,6 +68,7 @@ public enum AuthenticationType implements BaseEnum {
 | 
			
		|||
        throw new NullPointerException("未获取到对应平台");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -76,6 +77,7 @@ public enum AuthenticationType implements BaseEnum {
 | 
			
		|||
        this.code = code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -76,6 +76,7 @@ public enum CaptchaProviderType implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -64,10 +64,12 @@ public enum DataOrigin implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -62,10 +62,12 @@ public enum IdentityProviderCategory implements BaseEnum {
 | 
			
		|||
        this.providers = providers;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -94,6 +94,7 @@ public enum IdentityProviderType implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -102,6 +103,7 @@ public enum IdentityProviderType implements BaseEnum {
 | 
			
		|||
        return name;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -61,6 +61,7 @@ public enum Language implements BaseEnum {
 | 
			
		|||
        return locale;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -52,10 +52,12 @@ public enum MessageCategory implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -57,10 +57,12 @@ public enum MfaFactor implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -56,10 +56,12 @@ public enum MfaMode implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -60,10 +60,12 @@ public enum OrganizationType implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -62,10 +62,12 @@ public enum PermissionActionType implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -52,10 +52,12 @@ public enum PolicyEffect implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -56,10 +56,12 @@ public enum PolicyObjectType implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -65,10 +65,12 @@ public enum PolicySubjectType implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,8 +33,8 @@ public enum SmsType implements BaseEnum {
 | 
			
		|||
                                          */
 | 
			
		||||
                                         BIND_PHONE("bind_phone", "绑定手机号", MessageCategory.CODE),
 | 
			
		||||
                                         /**
 | 
			
		||||
                                           * 绑定,修改手机号成功
 | 
			
		||||
                                           */
 | 
			
		||||
                                          * 绑定,修改手机号成功
 | 
			
		||||
                                          */
 | 
			
		||||
                                         BIND_PHONE_SUCCESS("bind_phone_success", "绑定手机号成功",
 | 
			
		||||
                                                            MessageCategory.CODE),
 | 
			
		||||
                                         /**
 | 
			
		||||
| 
						 | 
				
			
			@ -110,10 +110,12 @@ public enum SmsType implements BaseEnum {
 | 
			
		|||
        this.category = category;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -59,10 +59,12 @@ public enum SyncStatus implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -46,10 +46,12 @@ public enum TriggerType implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -50,10 +50,12 @@ public enum UserGender implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -49,10 +49,12 @@ public enum UserIdType implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -66,10 +66,12 @@ public enum UserStatus implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -72,6 +72,7 @@ public enum UserType implements BaseEnum {
 | 
			
		|||
        throw new NullPointerException("未获取到类型");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -80,6 +81,7 @@ public enum UserType implements BaseEnum {
 | 
			
		|||
        this.code = code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -54,6 +54,7 @@ public enum AppCertUsingType implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -66,6 +66,7 @@ public enum AppProtocol implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -59,10 +59,12 @@ public enum AppType implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,10 +53,12 @@ public enum AuthorizationType implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,10 +53,12 @@ public enum InitLoginType implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -84,6 +84,7 @@ public enum SamlAttributeStatementValueType implements BaseEnum {
 | 
			
		|||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -80,6 +80,7 @@ public enum IdentitySourceProvider implements BaseEnum {
 | 
			
		|||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -88,6 +89,7 @@ public enum IdentitySourceProvider implements BaseEnum {
 | 
			
		|||
        return name;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -57,10 +57,12 @@ public enum IdentitySourceActionType implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -55,10 +55,12 @@ public enum IdentitySourceObjectType implements BaseEnum {
 | 
			
		|||
        this.desc = desc;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getCode() {
 | 
			
		||||
        return code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getDesc() {
 | 
			
		||||
        return desc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,6 +25,6 @@ import org.slf4j.LoggerFactory;
 | 
			
		|||
 * Created by support@topiam.cn on  2022/12/30 01:06
 | 
			
		||||
 */
 | 
			
		||||
public class CasUtils {
 | 
			
		||||
    private final static Logger logger = LoggerFactory.getLogger(CasUtils.class);
 | 
			
		||||
    private static final Logger logger = LoggerFactory.getLogger(CasUtils.class);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -61,7 +61,7 @@ import static org.opensaml.saml.common.xml.SAMLConstants.POST_METHOD;
 | 
			
		|||
 * Created by support@topiam.cn on  2022/5/18 21:54
 | 
			
		||||
 */
 | 
			
		||||
public class SamlUtils {
 | 
			
		||||
    private final static Logger        logger      = LoggerFactory.getLogger(SamlUtils.class);
 | 
			
		||||
    private static final Logger        logger      = LoggerFactory.getLogger(SamlUtils.class);
 | 
			
		||||
    private static final AtomicBoolean INITIALIZED = new AtomicBoolean(false);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,6 +17,8 @@
 | 
			
		|||
 */
 | 
			
		||||
package cn.topiam.employee.core.configuration;
 | 
			
		||||
 | 
			
		||||
import java.time.Duration;
 | 
			
		||||
 | 
			
		||||
import org.apache.http.client.config.RequestConfig;
 | 
			
		||||
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
 | 
			
		||||
import org.elasticsearch.client.RestClientBuilder;
 | 
			
		||||
| 
						 | 
				
			
			@ -24,8 +26,6 @@ import org.springframework.boot.autoconfigure.elasticsearch.RestClientBuilderCus
 | 
			
		|||
import org.springframework.context.annotation.Bean;
 | 
			
		||||
import org.springframework.context.annotation.Configuration;
 | 
			
		||||
 | 
			
		||||
import java.time.Duration;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * EiamElasticsearchConfiguration
 | 
			
		||||
 *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -54,7 +54,7 @@ public class PublicSecretEndpoint extends HttpServlet {
 | 
			
		|||
 | 
			
		||||
    public static final String  PUBLIC_SECRET_PATH = EiamConstants.API_PATH + "/public_secret";
 | 
			
		||||
 | 
			
		||||
    private final static String TYPE               = "type";
 | 
			
		||||
    private static final String TYPE               = "type";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取加密key
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -57,7 +57,7 @@ import static cn.topiam.employee.support.constant.EiamConstants.TOPIAM_ENCRYPT_S
 | 
			
		|||
public class DecryptRequestBodyAdvice extends RequestBodyAdviceAdapter {
 | 
			
		||||
    private final Logger        logger  = LoggerFactory.getLogger(DecryptRequestBodyAdvice.class);
 | 
			
		||||
 | 
			
		||||
    private final static String ENCRYPT = "encrypt";
 | 
			
		||||
    private static final String ENCRYPT = "encrypt";
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean supports(MethodParameter methodParameter, @NonNull Type targetType,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -180,7 +180,7 @@ public class OtpContextHelp {
 | 
			
		|||
    /**
 | 
			
		||||
     * 发送验证码频繁,请稍候重试
 | 
			
		||||
     */
 | 
			
		||||
    private final static String       SEND_FREQUENTLY             = "发送验证码频繁,请稍候重试";
 | 
			
		||||
    private static final String       SEND_FREQUENTLY             = "发送验证码频繁,请稍候重试";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 验证码 code 值前缀
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -107,6 +107,7 @@ public class DefaultPasswordWeakLibImpl implements PasswordWeakLib {
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean wordExists(String word) {
 | 
			
		||||
        synchronized (dictionary) {
 | 
			
		||||
            return Boolean.TRUE.equals(dictionary.get(word));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -46,7 +46,7 @@ public final class MessageSettingConstants {
 | 
			
		|||
    /**
 | 
			
		||||
     * 邮件内容路径
 | 
			
		||||
     */
 | 
			
		||||
    public final static String MAIL_CONTENT_PATH                 = CLASSPATH_URL_PREFIX
 | 
			
		||||
    public static final String MAIL_CONTENT_PATH                 = CLASSPATH_URL_PREFIX
 | 
			
		||||
                                                                   + "mail/content/";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,14 +25,14 @@ package cn.topiam.employee.identitysource.wechatwork.util;
 | 
			
		|||
 */
 | 
			
		||||
public class AesException extends Exception {
 | 
			
		||||
 | 
			
		||||
    public final static int VALIDATE_SIGNATURE_ERROR = -40001;
 | 
			
		||||
    public final static int PARSE_XML_ERROR          = -40002;
 | 
			
		||||
    public final static int COMPUTE_SIGNATURE_ERROR  = -40003;
 | 
			
		||||
    public final static int ILLEGAL_AES_KEY          = -40004;
 | 
			
		||||
    public final static int VALIDATE_CORP_ID_ERROR   = -40005;
 | 
			
		||||
    public final static int ENCRYPT_AES_ERROR        = -40006;
 | 
			
		||||
    public final static int DECRYPT_AES_ERROR        = -40007;
 | 
			
		||||
    public final static int ILLEGAL_BUFFER           = -40008;
 | 
			
		||||
    public static final int VALIDATE_SIGNATURE_ERROR = -40001;
 | 
			
		||||
    public static final int PARSE_XML_ERROR          = -40002;
 | 
			
		||||
    public static final int COMPUTE_SIGNATURE_ERROR  = -40003;
 | 
			
		||||
    public static final int ILLEGAL_AES_KEY          = -40004;
 | 
			
		||||
    public static final int VALIDATE_CORP_ID_ERROR   = -40005;
 | 
			
		||||
    public static final int ENCRYPT_AES_ERROR        = -40006;
 | 
			
		||||
    public static final int DECRYPT_AES_ERROR        = -40007;
 | 
			
		||||
    public static final int ILLEGAL_BUFFER           = -40008;
 | 
			
		||||
 | 
			
		||||
    private final int       code;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,12 +30,12 @@ public class OpenApiConstants {
 | 
			
		|||
    /**
 | 
			
		||||
     * OpenAPI 路径
 | 
			
		||||
     */
 | 
			
		||||
    public final static String OPEN_API_PATH            = API_PATH + "/openapi";
 | 
			
		||||
    public static final String OPEN_API_PATH            = API_PATH + "/openapi";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 权限管理API 路径
 | 
			
		||||
     */
 | 
			
		||||
    public final static String OPEN_API_PERMISSION_PATH = API_PATH + "/openapi/permission";
 | 
			
		||||
    public static final String OPEN_API_PERMISSION_PATH = API_PATH + "/openapi/permission";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 组名称
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -73,7 +73,7 @@ import static cn.topiam.employee.support.constant.EiamConstants.TOPIAM_BIND_MFA_
 | 
			
		|||
 */
 | 
			
		||||
@Slf4j
 | 
			
		||||
public class IdpBindUserAuthenticationFilter extends AbstractAuthenticationProcessingFilter {
 | 
			
		||||
    public final static String         DEFAULT_FILTER_PROCESSES_URI = USER_BIND_IDP;
 | 
			
		||||
    public static final String         DEFAULT_FILTER_PROCESSES_URI = USER_BIND_IDP;
 | 
			
		||||
    public static final RequestMatcher IDP_BIND_USER_MATCHER        = new AntPathRequestMatcher(
 | 
			
		||||
        DEFAULT_FILTER_PROCESSES_URI, HttpMethod.POST.name());
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -60,7 +60,7 @@ public class MfaAuthenticationFilter extends AbstractAuthenticationProcessingFil
 | 
			
		|||
    public static final String         SPRING_SECURITY_FORM_TOTP_KEY = "totp";
 | 
			
		||||
 | 
			
		||||
    public static final String         SPRING_SECURITY_FORM_TYPE_KEY = "type";
 | 
			
		||||
    public final static String         DEFAULT_FILTER_PROCESSES_URI  = MFA_VALIDATE;
 | 
			
		||||
    public static final String         DEFAULT_FILTER_PROCESSES_URI  = MFA_VALIDATE;
 | 
			
		||||
 | 
			
		||||
    public static final RequestMatcher MFA_LOGIN_MATCHER             = new AntPathRequestMatcher(
 | 
			
		||||
        DEFAULT_FILTER_PROCESSES_URI, HttpMethod.POST.name());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -49,6 +49,7 @@ public class TicketGrantingTicketImpl implements TicketGrantingTicket {
 | 
			
		|||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public UserDetails getUserDetails() {
 | 
			
		||||
        return this.userDetails;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
 | 
			
		|||
 */
 | 
			
		||||
public class Response10GeneratorImpl implements ResponseGenerator {
 | 
			
		||||
 | 
			
		||||
    private final static Logger       logger = LoggerFactory
 | 
			
		||||
    private static final Logger       logger = LoggerFactory
 | 
			
		||||
        .getLogger(Response20GeneratorImpl.class);
 | 
			
		||||
 | 
			
		||||
    private final HttpServletResponse response;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -46,7 +46,7 @@ import static cn.topiam.employee.protocol.cas.idp.constant.ProtocolConstants.*;
 | 
			
		|||
 */
 | 
			
		||||
public class Response20GeneratorImpl implements ResponseGenerator {
 | 
			
		||||
 | 
			
		||||
    private final static Logger       logger = LoggerFactory
 | 
			
		||||
    private static final Logger       logger = LoggerFactory
 | 
			
		||||
        .getLogger(Response20GeneratorImpl.class);
 | 
			
		||||
 | 
			
		||||
    private final HttpServletResponse response;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory;
 | 
			
		|||
 */
 | 
			
		||||
public class Response30GeneratorImpl extends Response20GeneratorImpl {
 | 
			
		||||
 | 
			
		||||
    private final static Logger logger = LoggerFactory.getLogger(Response20GeneratorImpl.class);
 | 
			
		||||
    private static final Logger logger = LoggerFactory.getLogger(Response20GeneratorImpl.class);
 | 
			
		||||
 | 
			
		||||
    public Response30GeneratorImpl(DocumentBuilder documentBuilder, HttpServletResponse response) {
 | 
			
		||||
        super(documentBuilder, response);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -47,7 +47,7 @@ import static cn.topiam.employee.protocol.oidc.util.EiamOAuth2Utils.getParameter
 | 
			
		|||
@SuppressWarnings({ "AlibabaClassNamingShouldBeCamel" })
 | 
			
		||||
public class EiamOAuth2AuthorizationPasswordAuthenticationConverter implements
 | 
			
		||||
                                                                    AuthenticationConverter {
 | 
			
		||||
    public final static String DEFAULT_ERROR_URI = "https://datatracker.ietf.org/doc/html/rfc6749#section-5.2";
 | 
			
		||||
    public static final String DEFAULT_ERROR_URI = "https://datatracker.ietf.org/doc/html/rfc6749#section-5.2";
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Authentication convert(HttpServletRequest request) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,7 +38,7 @@ public class RedisOAuth2AuthorizationConsentService implements OAuth2Authorizati
 | 
			
		|||
 | 
			
		||||
    private final RedisTemplate<Object, Object> redisTemplate;
 | 
			
		||||
 | 
			
		||||
    private final static Long                   TIMEOUT = 10L;
 | 
			
		||||
    private static final Long                   TIMEOUT = 10L;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void save(OAuth2AuthorizationConsent authorizationConsent) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -47,7 +47,7 @@ import lombok.RequiredArgsConstructor;
 | 
			
		|||
@RequiredArgsConstructor
 | 
			
		||||
public class RedisOAuth2AuthorizationService implements OAuth2AuthorizationService {
 | 
			
		||||
 | 
			
		||||
    private final static Long                   TIMEOUT       = 10L;
 | 
			
		||||
    private static final Long                   TIMEOUT       = 10L;
 | 
			
		||||
 | 
			
		||||
    private static final String                 AUTHORIZATION = "token";
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -99,7 +99,7 @@ public class Saml2IdpSingleSignOnEndpointFilter extends OncePerRequestFilter
 | 
			
		|||
                                                implements OrderedFilter {
 | 
			
		||||
    private static final Logger         logger          = LoggerFactory
 | 
			
		||||
        .getLogger(Saml2IdpSingleSignOnEndpointFilter.class);
 | 
			
		||||
    private final static RequestMatcher REQUEST_MATCHER = new AntPathRequestMatcher(
 | 
			
		||||
    private static final RequestMatcher REQUEST_MATCHER = new AntPathRequestMatcher(
 | 
			
		||||
        Saml2EndpointConstants.SAML_SSO_PATH);
 | 
			
		||||
    private final RedirectCache         redirectCache   = new HttpSessionRedirectCache();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -257,7 +257,7 @@ public class Saml2IdpSingleSignOnEndpointFilter extends OncePerRequestFilter
 | 
			
		|||
    /**
 | 
			
		||||
     * Velocity 引擎
 | 
			
		||||
     */
 | 
			
		||||
    public final static VelocityEngine VELOCITY_ENGINE;
 | 
			
		||||
    public static final VelocityEngine VELOCITY_ENGINE;
 | 
			
		||||
 | 
			
		||||
    static {
 | 
			
		||||
        VELOCITY_ENGINE = new VelocityEngine();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -73,7 +73,7 @@ public class Saml2IdpSingleSignOutEndpointFilter extends OncePerRequestFilter
 | 
			
		|||
 | 
			
		||||
    private final Logger                logger          = LoggerFactory
 | 
			
		||||
        .getLogger(Saml2IdpSingleSignOutEndpointFilter.class);
 | 
			
		||||
    private final static RequestMatcher REQUEST_MATCHER = new AntPathRequestMatcher(
 | 
			
		||||
    private static final RequestMatcher REQUEST_MATCHER = new AntPathRequestMatcher(
 | 
			
		||||
        ProtocolConstants.Saml2EndpointConstants.SAML_LOGOUT_PATH);
 | 
			
		||||
 | 
			
		||||
    public static RequestMatcher getRequestMatcher() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -60,7 +60,7 @@ import static cn.topiam.employee.common.util.SamlUtils.generateSecureRandomId;
 | 
			
		|||
@RequiredArgsConstructor
 | 
			
		||||
@Getter
 | 
			
		||||
public class AssertionGenerator {
 | 
			
		||||
    private final static Logger                          logger = LoggerFactory
 | 
			
		||||
    private static final Logger                          logger = LoggerFactory
 | 
			
		||||
        .getLogger(AssertionGenerator.class);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,7 +43,7 @@ import lombok.RequiredArgsConstructor;
 | 
			
		|||
@RequiredArgsConstructor
 | 
			
		||||
@Getter
 | 
			
		||||
public class AttributeStatementGenerator {
 | 
			
		||||
    private final static Logger                          logger = LoggerFactory
 | 
			
		||||
    private static final Logger                          logger = LoggerFactory
 | 
			
		||||
        .getLogger(AttributeStatementGenerator.class);
 | 
			
		||||
    /**
 | 
			
		||||
     * 断言属性
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,7 +38,7 @@ import cn.topiam.employee.support.context.ServletContextHelp;
 | 
			
		|||
 * Created by support@topiam.cn on  2022/6/1 22:52
 | 
			
		||||
 */
 | 
			
		||||
public class AuthnStatementGenerator {
 | 
			
		||||
    private final static Logger            logger = LoggerFactory
 | 
			
		||||
    private static final Logger            logger = LoggerFactory
 | 
			
		||||
        .getLogger(AuthnStatementGenerator.class);
 | 
			
		||||
    private final AuthnContextClassRefType authnContextClassRefType;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,7 +38,7 @@ import lombok.AllArgsConstructor;
 | 
			
		|||
 */
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public class ConditionsGenerator {
 | 
			
		||||
    private final static Logger logger = LoggerFactory.getLogger(ConditionsGenerator.class);
 | 
			
		||||
    private static final Logger logger = LoggerFactory.getLogger(ConditionsGenerator.class);
 | 
			
		||||
    /**
 | 
			
		||||
     * audienceUri
 | 
			
		||||
     */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory;
 | 
			
		|||
 */
 | 
			
		||||
public class UrlTestUtils {
 | 
			
		||||
 | 
			
		||||
    private final static Logger logger = LoggerFactory.getLogger(UrlTestUtils.class);
 | 
			
		||||
    private static final Logger logger = LoggerFactory.getLogger(UrlTestUtils.class);
 | 
			
		||||
 | 
			
		||||
    public static boolean testUrlWithTimeOut(String urlString, int timeOutMillSeconds) {
 | 
			
		||||
        try {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,10 +30,10 @@ public final class SynchronizerConstants {
 | 
			
		|||
    /**
 | 
			
		||||
     * 同步器事件接收路径
 | 
			
		||||
     */
 | 
			
		||||
    public final static String EVENT_PATH         = EiamConstants.API_PATH + "/event";
 | 
			
		||||
    public static final String EVENT_PATH         = EiamConstants.API_PATH + "/event";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 同步器事件接收路径
 | 
			
		||||
     */
 | 
			
		||||
    public final static String EVENT_RECEIVE_PATH = EVENT_PATH + "/receive";
 | 
			
		||||
    public static final String EVENT_RECEIVE_PATH = EVENT_PATH + "/receive";
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue