Просмотр исходного кода

Fix 修复微软三方对接参数缺失

Yue 1 неделя назад
Родитель
Сommit
c05e3eb4ff

+ 6 - 1
SERVER/VberAdminPlusV3/vber-common/vber-common-social/src/main/java/com/vber/common/social/config/properties/SocialLoginConfigProperties.java

@@ -28,10 +28,15 @@ public class SocialLoginConfigProperties {
     private String redirectUri;
 
     /**
-     * 是否获取unionId
+     * 是否需要申请unionid,目前只针对qq登录
      */
     private boolean unionId;
 
+    /**
+     * Microsoft Entra ID(原微软 AAD)中的租户 ID
+     */
+    private String tenantId;
+
     /**
      * Coding 企业名称
      */

+ 4 - 4
SERVER/VberAdminPlusV3/vber-common/vber-common-social/src/main/java/com/vber/common/social/utils/SocialUtils.java

@@ -24,7 +24,7 @@ public class SocialUtils {
     private static final AuthRedisStateCache STATE_CACHE = SpringUtils.getBean(AuthRedisStateCache.class);
 
     public static AuthResponse<AuthUser> loginAuth(String source, String code, String state,
-                                                   SocialProperties socialProperties) throws AuthException {
+            SocialProperties socialProperties) throws AuthException {
         AuthRequest authRequest = getAuthRequest(source, socialProperties);
         AuthCallback callback = new AuthCallback();
         callback.setCode(code);
@@ -58,13 +58,13 @@ public class SocialUtils {
             case "taobao" -> new AuthTaobaoRequest(builder.build(), STATE_CACHE);
             case "douyin" -> new AuthDouyinRequest(builder.build(), STATE_CACHE);
             case "linkedin" -> new AuthLinkedinRequest(builder.build(), STATE_CACHE);
-            case "microsoft" -> new AuthMicrosoftRequest(builder.build(), STATE_CACHE);
+            case "microsoft" -> new AuthMicrosoftRequest(builder.tenantId(obj.getTenantId()).build(), STATE_CACHE);
             case "renren" -> new AuthRenrenRequest(builder.build(), STATE_CACHE);
             case "stack_overflow" ->
-                    new AuthStackOverflowRequest(builder.stackOverflowKey(obj.getStackOverflowKey()).build(), STATE_CACHE);
+                new AuthStackOverflowRequest(builder.stackOverflowKey(obj.getStackOverflowKey()).build(), STATE_CACHE);
             case "huawei" -> new AuthHuaweiV3Request(builder.build(), STATE_CACHE);
             case "wechat_enterprise" ->
-                    new AuthWeChatEnterpriseQrcodeV2Request(builder.agentId(obj.getAgentId()).build(), STATE_CACHE);
+                new AuthWeChatEnterpriseQrcodeV2Request(builder.agentId(obj.getAgentId()).build(), STATE_CACHE);
             case "gitlab" -> new AuthGitlabRequest(builder.build(), STATE_CACHE);
             case "wechat_mp" -> new AuthWeChatMpRequest(builder.build(), STATE_CACHE);
             case "aliyun" -> new AuthAliyunRequest(builder.build(), STATE_CACHE);