简体   繁体   English

WSO2 身份服务器:按用户名 api 搜索用户无效

[英]WSO2 Identity Server: Searching user by their username api not working

Is there any API available to fetch the details of a user using their username only?是否有任何 API 可用于仅使用用户名获取用户的详细信息?

I've followed this https://is.docs.wso2.com/en/latest/develop/scim2-rest-apis/#/Users%20Endpoint/getUsersByPost我已经关注了这个https://is.docs.wso2.com/en/latest/develop/scim2-rest-apis/#/Users%20Endpoint/getUsersByPost

But it doesn't work但它不起作用

请参阅邮递员请求的附加屏幕截图

  1. The URL you were trying was wrong.您尝试的 URL 是错误的。
  • SCIM v1 users endpoint: https://localhost:9443/wso2/scim/Users SCIM v1 用户端点: https://localhost:9443/wso2/scim/Users
  • SCIM v2 users endpoint: https://localhost:9443/scim2/Users SCIM v2 用户端点: https://localhost:9443/scim2/Users
  1. On the payload, you have mentioned scim v1 schema.在有效负载上,您提到了 scim v1 架构。 Maybe you wanted to try the API in scim v1, but we recommend using V2.也许您想在 scim v1 中尝试 API,但我们建议使用 V2。

Following are sample requests for your requirement in SCIM V2.以下是您在 SCIM V2 中的要求的示例请求。

If you want to use POST request to /Users/.search endpoint:如果你想对/Users/.search端点使用POST请求:

curl --location --request POST 'https://localhost:9443/scim2/Users/.search' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--header 'Content-Type: application/json' \
--data-raw '{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:SearchRequest"
    ],
    "attributes": [
        "userName",
        "name"
    ],
    "filter": "userName eq userA",
    "domain": "PRIMARY",
    "startIndex": "1",
    "count": "10"
}'

If you want to use GET request to /Users endpoint:如果要对/Users端点使用GET请求:

curl --location --request GET 'https://localhost:9443/scim2/Users?startIndex=1&attributes=userName,Name&count=10&filter=username%20eq%20userA&' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--data-raw ''

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

相关问题 如果用户在 wso2 身份服务器中尝试失败,我如何在 wso2 日志中记录用户名 - how can i log username in wso2 logs in case of failed attempt of a user in wso2 identity server 用户帐户暂停在 WSO2 Identity Server 5.10.0 中不起作用 - User Account Suspension is not working in WSO2 Identity Server 5.10.0 使用 WSO2 Identity Server 和 WSO2 API Manager 保护后端 - Securing backend with WSO2 Identity Server and WSO2 API Manager WSO2 身份服务器:更新用户失败 - WSO2 Identity Server: update user fails WSO2 身份服务器 Email OTP 使用 REST API - WSO2 Identity Server Email OTP using REST API 通过文件将服务提供商添加到 WSO2 身份服务器不起作用 - Adding Service Provider to WSO2 Identity Server via file is not working WSO2 Identity Server 用户门户和 Active Directory - WSO2 Identity Server User Portal and Active Directory wso2 身份服务器:Oauth 2.0 自定义授权不适用于 5.11 - wso2 identity server: Oauth 2.0 custom grant is not working for 5.11 我可以将多个 WSO2 API 管理器(AM)与单个 WSO2 身份服务器(IS)链接起来吗? - Can i link multiple WSO2 API Managers(AM) with a single WSO2 Identity Server(IS)? 在自我注册和挑战问题 API 中查找 6.0.0 版本的 WSO2 身份服务器的 SOAP API 的替代品 - Finding the replacement of the SOAP APIs for WSO2 identity server for 6.0.0 version in that Self Sign-Up and Challenge Questions API are not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM