使用登录和订阅权限向 WSO2 API-M 添加新角色不允许用户登录订阅者门户

Adding new roles to WSO2 API-M with login & subscribe permissions does not allow user to login to subscriber portal

我正在使用 WSO2 API-M v3.0.0,并且我创建了一个具有登录和订阅权限的新角色(与授予 "Internal/subscriber" 角色的权限相同)。但是这个新角色中的用户无法登录订阅者门户,因为访问被拒绝。我看到的唯一解决方法是将这些用户添加到新角色和 Internal/subscriber 角色中。

创建新角色时是否需要进行任何其他更改?我使用多租户环境。

从APIM 3.0开始,基于权限的访问控制模型被基于角色+基于权限的模型所取代。因此,默认情况下,您的用户需要具有 Internal/subscriber 角色才能访问开发人员门户。

这是它的工作原理。要访问开发人员门户,用户应该能够获得具有 apim:api_subscribe 范围的访问令牌。为此,用户需要具有 Internal/subscriber 角色。此映射在注册表的 /_system/config/apimgt/applicationdata/tenant-conf.json 文件中配置。因此,在您的情况下,您必须将新角色添加到此文件中。

从 APIM 3.1 开始,将有一个 UI 来配置它,这将比我们现在拥有的更容易。

来自文档[1]。

In WSO2 API Manager 3.0.0, Developer Portal and Publisher Web Application UIs are populated by API-M REST APIs and all the authentication and authorization to access the different components in the UI solely depend on the scope role mapping defined in /_system/config/apimgt/applicationdata/tenant-conf.json that can be accessed through the Management Console from Resources > Browse.

By default, the scope-role mapping contains Internal/creator, Internal/publisher, Internal/subscriber as the default roles. If there are custom roles defined with API creator, API publisher, admin and API subscriber permissions, those roles have to be configured in tenant-conf.json under relevant scopes.

[1] https://apim.docs.wso2.com/en/latest/Administer/ProductAdministration/ManagingUsersAndRoles/managing-user-roles/