WSO2 身份服务器 - SCIM2 API 被其他应用程序调用(client_id 和秘密)

WSO2 Identity Server - SCIM2 API called by other application (client_id and secret)

我正在尝试从另一个应用程序向 WSO2 Identity Server v5.10.0 提供用户。

根据文档,我可以通过 SCIM2 REST APIs 做到这一点,有很好的 cURL 示例可以传递具有适当权限的用户凭据,如您所见 here

在我的案例中,我唯一拥有的是 client_idsecret 由 WSO2 API 管理器生成并集成到此 WSO2IS。

当我调用 API 在 header 中传递生成的令牌时,它 returns 403.

如何从另一个应用程序调用 WSO2IS SCIM2 API?

提前致谢!

如果您导航到<PRODUCT_HOME>/repository/conf/identity/identity.xml文件,您可以找到如下内容。

<Resource context="(.*)/scim2/Users(.*)" secured="true" http-method="POST">
            <Permissions>/permission/admin/manage/identity/usermgt/create</Permissions>
            <Scopes>internal_user_mgt_create</Scopes>
</Resource>
<Resource context="(.*)/scim2/Users" secured="true" http-method="GET">
            <Permissions>/permission/admin/manage/identity/usermgt/list</Permissions>
            <Scopes>internal_user_mgt_list</Scopes>
</Resource> .....

这些配置与每个 SCIM 端点的安全方式有关。在 https://is.docs.wso2.com/en/latest/develop/authenticating-and-authorizing-rest-apis/#secure-resources

中查找更多详细信息

如果您使用基本身份验证(用户名和密码),则拥有凭据的用户需要相关端点的上述权限。 同样,如果您使用访问令牌,它应该在上述范围内生成。如果访问令牌没有所需的范围,您将收到 403 Forbidden。

例如: 为了创建 SCIM 用户,您应该使用具有 internal_user_mgt_create 范围的访问令牌。