0

我正在使用以下 curl 命令通过 SCIM Rest API 测试 WSO2 5.10 用户创建

curl -v -k --user admin:admin --data "{"schemas":[],"name":{"familyName":"Smith","givenName":"John"},"userName":"john","password":"password","emails":[{"primary":true,"value":"jsmith@test.com","type":"home"},{"value":"jsmith@test.com","type":"work"},{"value":"jsmith@test.com"}],"EnterpriseUser":{askPassword:"true"}}" --header "Content-Type:application/json" https://localhost:9443/scim2/Users 

它按预期创建用户,但不发送电子邮件来设置密码。但是,当管理员尝试通过管理控制台为同一场景创建用户时,用户会收到一封电子邮件以设置密码。但不是通过这个 API 请求。

我究竟做错了什么?

4

1 回答 1

1

您需要在 SCIM2 用户创建请求中将 schema下的askPassword属性设置为 true。urn:ietf:params:scim:schemas:extension:enterprise:2.0:User所以试试下面的请求,

curl -v -k --user admin:admin --data '{"schemas":[],"name":{"familyName":"Smith","givenName":"John"},"userName":"john","password":"password","emails":[{"primary":true,"value":"jsmith@test.com","type":"home"},{"value":"jsmith@test.com","type":"work"},{"value":"jsmith@test.com"}],"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{askPassword:"true"}}' --header "Content-Type:application/json" https://localhost:9443/scim2/Users

更多细节请参考官方文档

于 2020-05-27T17:35:42.007 回答