繁体   English   中英

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

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

是否有任何 API 可用于仅使用用户名获取用户的详细信息?

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

但它不起作用

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

  1. 您尝试的 URL 是错误的。
  • SCIM v1 用户端点: https://localhost:9443/wso2/scim/Users
  • SCIM v2 用户端点: https://localhost:9443/scim2/Users
  1. 在有效负载上,您提到了 scim v1 架构。 也许您想在 scim v1 中尝试 API,但我们建议使用 V2。

以下是您在 SCIM V2 中的要求的示例请求。

如果你想对/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"
}'

如果要对/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.

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