[英]How to register REST client in WSO2 API Manager
我一直在浏览 wso2 apim 的文档。 https://docs.wso2.com/display/AM1100/apidocs/store/index.html#guide
并找到了 curl 请求:
curl -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d @payload.json http://localhost:9763/client-registration/v0.9/register
带有效载荷:
{
"callbackUrl": "www.google.lk",
"clientName": "rest_api_store",
"tokenScope": "Production",
"owner": "admin",
"grantType": "password refresh_token",
"saasApp": true
}
但是我得到了 403 错误响应。 正如预期的那样,我应该得到正确的响应负载,例如:
{
"callBackURL": "www.google.lk",
"jsonString":
"{
\"username\":\"admin\",
\"redirect_uris\":\"www.google.lk\",
\"tokenScope\":[Ljava.lang.String;@3a73796a,
\"client_name\":\"admin_rest_api_store\",
\"grant_types\":\"authorization_code password refresh_token iwa:ntlm
urn:ietf:params:oauth:grant-type:saml2-bearer client_credentialsimplicit\"
}",
"clientName": null,
"clientId": "HfEl1jJPdg5tbtrxhAwybN05QGoa",
"clientSecret": "l6c0aoLcWR3fwezHhc7XoGOht5Aa"
}
我不知道发生了什么,我只是按照上面的文档进行操作,没有任何更改。 如果有人可以提供帮助,我们将不胜感激。 谢谢。
看起来您的 DCR 呼叫被某个安全过滤器阻止。 可能是因为您到达了错误的终点。
我相信您正在使用 APIM 2.0.0。 如果是,您的 DCR 网址应该是这个。 (注意版本v0.10
)
http://localhost:9763/client-registration/v0.10/register
尝试看看这是否能解决您的问题。
更新:看起来这个 URL 在2.0.0 docs上是错误的。 我会联系 WSO2 Docs 团队来修复它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.