简体   繁体   English

将用户添加到 WSO2 身份服务器

[英]Adding a user to WSO2 Identity Server



We're integrating our asp.net MVC client with WSO2's Identity Server v5.8.0.我们正在将我们的 asp.net MVC 客户端与 WSO2 的 Identity Server v5.8.0 集成。 Below are the steps we've followed:以下是我们遵循的步骤:
1) Created a Service provider for our MVC application & configured Inbound authentication with OAuth/OpenID configuration, also configured Inbound provisioning with primary user store. 1) 为我们的 MVC 应用程序创建了一个服务提供者,并使用 OAuth/OpenID 配置配置了入站身份验证,还配置了具有主要用户存储的入站配置。
2) In our MVC application, we've set up a WSO2 configuration using OWIN's WSO2 NuGet package with the generated client-id & client-secret from the service provider. 2) 在我们的 MVC 应用程序中,我们使用 OWIN 的 WSO2 NuGet 包设置了 WSO2 配置,其中包含从服务提供商生成的客户端 ID 和客户端机密。
3) We've configured MongoDB as our primary user store. 3) 我们已将 MongoDB 配置为我们的主要用户存储。

Now we're trying to add a user using SCIM2 API ( https://localhost:9443/scim2/Users ).现在我们正在尝试使用 SCIM2 API ( https://localhost:9443/scim2/Users )添加用户 Below is the response we're getting:以下是我们得到的回应:

{"schemas":["urn:ietf:params:scim:api:messages:2.0:Error"],"detail":"Cannot add user through scim to user store . SCIM is not enabled for user store WSO2.COM","status":"500"}

I've even changed below config in user-mgt.xml我什至在 user-mgt.xml 中更改了以下配置

<Property name="SCIMEnabled">true</Property>

What else do we need to configure?我们还需要配置什么? Is there any other way to add user in WSO2 Identity server apart from using SCIM APIs?除了使用 SCIM API 之外,还有其他方法可以在 WSO2 身份服务器中添加用户吗?

It seems like you are having two user stores the primary user store and a secondary user store named wso2.com .看起来您有两个用户存储,主要用户存储和名为wso2.com的辅助用户存储。 By adding the通过添加

<Property name="SCIMEnabled">true</Property>

To the user-mgt.xml you are enabling SCIM2 to the primary user store.对于 user-mgt.xml,您正在为主要用户存储启用 SCIM2。 Not the secondary user store.不是二级用户存储。 But from the API you are adding the user to the secondary user store.但是从 API 中,您将用户添加到辅助用户存储中。 Since you havent enabled SCIM in the secondary user store you are getting this error.由于您尚未在辅助用户存储中启用 SCIM,因此您会收到此错误。 You have two options.你有两个选择。

1) Add the user to PRIMARY user store 1) 将用户添加到 PRIMARY 用户存储

By analyzing the error that you are getting the user name of the user that you are trying to add should be some thing like通过分析您正在尝试添加的用户的用户名的错误应该是这样的

WSO2.COM/Abhishek

Change this to将此更改为

Abhishek

2) Enable SCIM2 in the secondary user store 2)在二级用户存储中启用SCIM2

Log in to the management console and click list in User Stores sub menu under identity menu.登录管理控制台,单击身份菜单下用户存储子菜单中的列表。 The User Store Management page opens.用户存储管理页面打开。 There should be a user store named WSO2.COM Click on edit.应该有一个名为 WSO2.COM 的用户存储 单击编辑。 Click on advanced tick the enable scim单击高级勾选启用 scim

在此处输入图片说明

Reference: https://docs.wso2.com/display/IS580/Using+the+SCIM+2.0+REST+APIs参考: https : //docs.wso2.com/display/IS580/Using+the+SCIM+2.0+REST+APIs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM