WSO2 身份服务器 - 根据用户角色限制服务提供商的入站身份验证

WSO2 Identity server - Restrict Inbound Authentication of service provider based on user's role

我在 wso2 IS 中创建了一个租户 'A' 并在其中添加了我的 ldap 用户存储。在租户 'A' 中,我配置了一个 'test' 服务提供商,使用 oauth2 作为入站身份验证。截至目前,我已成功通过 oauth2 服务提供商配置对商店中的所有用户进行身份验证。

但如果用户没有特定角色,我找不到任何配置来限制用户对服务提供商进行身份验证'A'。

大约五年前有人问过这个问题,但当时不支持,我想知道如何在 WSO2 Identity Server 5.7.4 中完成此问题

选项 1:

您可以使用自适应脚本并根据角色限制身份验证。请参阅此文档以了解如何为服务提供商配置基于角色的自适应脚本 A https://docs.wso2.com/display/IS570/Configuring+Role-Based+Adaptive+Authentication

选项2:

使用 XACML 脚本控制基于角色的身份验证。请参阅此文档以了解 XAML。 https://docs.wso2.com/display/IS570/Working+with+XACML.

您可以参考此文档了解如何编写 XACML 策略https://docs.wso2.com/display/IS570/Writing+XACML3+Policies+in+WSO2+Identity+Server. In the managment console, you can find a sample XACML script authn_role_based_policy_template. Modify that script according to your Service provider name and role. Then publish it. You can use this doc as well. https://docs.wso2.com/display/IS570/Configuring+Access+Control+Policy+for+a+Service+Provider