2
votes

I've been looking through the doc of wso2 apim. https://docs.wso2.com/display/AM1100/apidocs/store/index.html#guide

And found the curl request:

curl -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d @payload.json http://localhost:9763/client-registration/v0.9/register

With payload:

{
"callbackUrl": "www.google.lk",
"clientName": "rest_api_store",
"tokenScope": "Production",
"owner": "admin",
"grantType": "password refresh_token",
"saasApp": true
}

But I got and 403 error response. As expected I should get the correct response payload like:

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

I have not idea what's going on, I just followed the doc above and without any changes. Will be appreciated if anyone can help. Thanks.

1

1 Answers

2
votes

Looks like your DCR call is being blocked by some security filter. May be because you're reaching a wrong endpoint.

I believe you're using APIM 2.0.0. If yes, your DCR url should be this. (note version v0.10)

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

Try and see if this solves your issue.

Update: Looks like this URL is wrong on 2.0.0 docs. I'll reach WSO2 Docs team to fix it.