简体   繁体   English

如何验证询问密码确认码 wso2 SCIM 2 API

[英]How to validate ask password confirmation code wso2 SCIM 2 API

I am using SCIM api for registering a user我正在使用 SCIM api 注册用户

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

I got a我有一个

Create Password for New Account为新帐户创建密码

email to my primary email address with a confirmation code. email 到我的主要 email 地址和确认码。

How to validate this confirmation code with wso2is using SCIM 2?如何使用 SCIM 2 使用 wso2is 验证此确认码?

In REST API there is an option to validate code .在 REST API 中有一个验证代码的选项。

I tried REST API我试过 REST API

curl -k -v -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d '{ "code": "84325529-8aa7-4851-8751-5980a7f2d9f7","properties": []}' "https://localhost:9443/api/identity/user/v1.0/validate-code"

it returns in case of invalid code如果代码无效,它会返回

{
    "code": "18001",
    "message": "Bad Request",
    "description": "Invalid Code '84325529-8aa7-4851-8751-5980a7f2d9f7'"
}

in the case valid code it returns在它返回的有效代码的情况下

{
    "code": "18001",
    "message": "Bad Request",
    "description": "Invalid Code '%s.'"
}

no console error没有控制台错误

Validate code worked with REST API work flow验证代码与REST API 工作流程一起使用

There is no such SCIM APIs in WSO2 Identity Server to validate the confirmation codes. WSO2 身份服务器中没有这样的 SCIM API 来验证确认代码。 WSO2 Identity Server has a soap API (UserInformationRecoveryService-verifyConfirmationCode) and a REST API (/validate-code) that can fulfill your requirement. WSO2 Identity Server 有一个可以满足您要求的soap API(UserInformationRecoveryService-verifyConfirmationCode)和一个REST API(/validate-code)。

You can find the SOAP API here .您可以在此处找到 SOAP API。

I am editing my answer here since I talked with the developers and I realised there is a different API that you need to use for validating the confirmation code: documentation .自从我与开发人员交谈后,我在这里编辑我的答案,我意识到您需要使用不同的 API 来验证确认代码: 文档

So you need to send the following request:所以你需要发送以下请求:

curl -k -v -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d '{ "code": "84325529-8aa7-4851-8751-5980a7f2d9f7","step": "UPDATE_PASSWORD","properties": []}' "https://localhost:9443/api/identity/recovery/v0.9/validate-code"

and the response should be并且响应应该是

"HTTP/1.1 202 Accepted"

I tried it and it works.我试过了,它有效。

Note: if you are using SCIM identity through a system like a self-managed GitLab, GitLab 15.3 (August 2022) offers a better integration:注意:如果您通过自我管理的 GitLab、 GitLab 15.3 (2022 年 8 月)等系统使用 SCIM 身份,则可以提供更好的集成:

User SCIM identity visible in UI UI 中可见的用户 SCIM 身份

Previously, the SCIM identity for a user could only be accessed using the SCIM API .以前,只能使用SCIM API访问用户的 SCIM 身份。

Now, a user's SCIM identity is visible to GitLab administrators in the Identities tab of the User list.现在,GitLab 管理员可以在“用户”列表的“身份”选项卡中看到用户的 SCIM 身份。 With this, troubleshooting of SCIM-related issues is simplified.这样,与 SCIM 相关的问题的故障排除就变得简单了。 Administrators can validate what identity, if any, is being used for a specific account without requiring GitLab Support or an API query.管理员无需 GitLab 支持或 API 查询即可验证用于特定帐户的身份(如果有)。

See Documentation and Issue .请参阅文档问题

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

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