如何在WSO2 API Manager中注册REST客户端

时间:2016-10-09 10:04:51

标签: wso2 wso2-am

我一直在查看wso2 apim的文档。 https://docs.wso2.com/display/AM1100/apidocs/store/index.html#guide

找到了卷曲请求:

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"
}

我不知道发生了什么,我只是按照上面的文档进行操作,没有任何更改。 如果有人可以帮忙,将不胜感激。 感谢。

1 个答案:

答案 0 :(得分:1)

您的DCR呼叫看起来被某些安全过滤器阻止了。可能是因为您到达了错误的终点。

我相信您正在使用API​​M 2.0.0。如果是,您的DCR网址应为此。 (注意版本v0.10

http://localhost:9763/client-registration/v0.10/register

尝试看看这是否能解决您的问题。

更新:2.0.0 docs看起来此网址有误。我将联系WSO2 Docs团队进行修复。