繁体   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