簡體   English   中英

在 WSO2 身份服務器 5.10.0 中將本地用戶帳戶鏈接到聯合用戶的正確方法是什么

[英]What is the correct way of linking local user account to federated user in WSO2 Identity server 5.10.0

我在 WSO2 5.10.0 中使用Google 身份驗證器(Oauth2 客戶端)作為身份提供程序。 我創建了一個使用這個谷歌身份驗證器作為聯合身份驗證服務提供者

當用戶第一次使用谷歌憑據(gmail)登錄時,我可以通過身份提供商中的即時配置將用戶存儲在本地用戶存儲中來創建本地用戶。 https://is.docs.wso2.com/en/latest/learn/configuring-just-in-time-provisioning-for-an-identity-provider/

第一次登錄后,我手動為本地用戶分配角色。

現在,當用戶使用聯合(谷歌)身份驗證再次登錄時,我提供給本地用戶的角色不會與聯合用戶建立鏈接。

我讀到了關聯用戶帳戶https://is.docs.wso2.com/en/latest/learn/associating-user-accounts/使用 Z10F5E949F59263A67AC4D57B58C82FC7

我嘗試添加

[user.association] enable_for_federated_users = true

deployment.toml中。 但是當我打開用戶門戶時,我只看到將本地用戶帳戶鏈接到另一個本地用戶帳戶的選項。

我想將用戶帳戶與聯合用戶相關聯,這樣當聯合用戶登錄時,它會獲取之前提供給本地用戶的角色並通過基於 XACML 角色的策略。

XAMCL 政策


<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"  PolicyId="role_based_login_policy" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" Version="1.0">
   <Description>This policy template provides ability to authorize users to a given service provider(defined by SP_NAME) in the authentication flow based on the roles of the user (defined by ROLE_1 and ROLE_2). Users who have at least one of the given roles, will be allowed and any others will be denied.</Description>
   <Target>
      <AnyOf>
         <AllOf>
            <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
               <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">SP_Name</AttributeValue>
               <AttributeDesignator AttributeId="http://wso2.org/identity/sp/sp-name" Category="http://wso2.org/identity/sp" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"></AttributeDesignator>
            </Match>
            <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
               <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">authenticate</AttributeValue>
               <AttributeDesignator AttributeId="http://wso2.org/identity/identity-action/action-name" Category="http://wso2.org/identity/identity-action" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"></AttributeDesignator>
            </Match>
         </AllOf>
      </AnyOf>
   </Target>
   <Rule Effect="Permit" RuleId="permit_by_roles">
      <Condition>
         <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:or">
            <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-is-in">
               <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">admin</AttributeValue>
               <AttributeDesignator AttributeId="http://wso2.org/claims/role" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></AttributeDesignator>
            </Apply>
         </Apply>
      </Condition>
   </Rule>
   <Rule Effect="Deny" RuleId="deny_others"></Rule>
</Policy>

在最新版本的 Identity Server(包括 5.10.0)中,當啟用即時供應時,聯合用戶和本地用戶會自動關聯。 因此,您不需要啟用您提到的配置,並且正如文檔所提到的,不建議這樣做。

因此,如果您想將本地配置用戶的屬性發送到應用程序,您必須Assert identity using mapped local subject identifier

在此處輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM