vchhoa | 2020-01-03 14:49:31 UTC | #1
Hello Team,
Customer would like to integrate their web services into some inbound flow. This web service is using OAuth 2 for authentification. I was provided the following information :
loginUrl : https://xxxxxxxxxx.com/maam/v1/token clientId : xxxxxxxxxx clientSecret : xxxxxxxxxxxxx scope : xxxxxxxxx
So I created the following Integration :
And it created the following Data Action for Custom Auth:
If I tried like this, I got the following error (which was expected) :
{ "status": 400, "code": "bad.request", "message": "The request could not be understood by the server due to malformed syntax.", "messageParams": {}, "contextId": "6ceb9b2d-7538-4aa3-bed3-9040f6521632", "details": [ { "errorCode": "ACTION.REMOTEENDPOINT" } ], "errors": [ { "status": 400, "code": "BADREQUEST", "message": "REST call for action execute failed. Message:Request to backend service failed. Response from web service: {\n\t\"error\": \"invalid_scope\"\n} [6ceb9b2d-7538-4aa3-bed3-9040f6521632]", "messageParams": {}, "details": [], "errors": [] } ] }
I then filled the scope in the "Request Body Template" part:
But then I got the following error:
{ "status": 400, "code": "bad.request", "message": "The request could not be understood by the server due to malformed syntax.", "messageParams": {}, "contextId": "982fd4a6-532f-4ee4-875b-2f12587c809a", "details": [ { "errorCode": "ACTION.REMOTEENDPOINT" } ], "errors": [ { "status": 400, "code": "BADREQUEST", "message": "REST call for action execute failed. Message:Request to backend service failed. Response from web service: {\n\t\"error\": \"invalid_grant\"\n} [982fd4a6-532f-4ee4-875b-2f12587c809a]", "messageParams": {}, "details": [], "errors": [] } ] }
I tried various syntax:
"granttype"="clientcredentials", "scope"="urn:axa:france:fca-sdm-cst"
Or
{ "granttype":"clientcredentials", "scope":"urn:axa:france:fca-sdm-cst" }
But still got the same error invalid_grant
I even try to put the scope in the integration:
Or
But it doesn't seem to be taken into account since I have the following error:
{ "status": 400, "code": "bad.request", "message": "The request could not be understood by the server due to malformed syntax.", "messageParams": {}, "contextId": "0a24a389-d7bf-441c-961f-ff92c01f49ae", "details": [ { "errorCode": "ACTION.REMOTEENDPOINT" } ], "errors": [ { "status": 400, "code": "BADREQUEST", "message": "REST call for action execute failed. Message:Request to backend service failed. Response from web service: {\n\t\"error\": \"invalid_scope\"\n} [0a24a389-d7bf-441c-961f-ff92c01f49ae]", "messageParams": {}, "details": [], "errors": [] } ] }
On Postman, it's working fine and I can manage to get a token :
Anyone would know if I'm doing wrong something ?
Cheers, Valéry Chhoa
Gurwan_Duplenne | 2020-01-03 15:06:18 UTC | #2
Hello Valery,
You should put clientId, clientSecret and scope in Request Body template, and with '&' to separate parameters
Hope it helps :slight_smile:
Gurwan
vchhoa | 2020-01-03 15:21:05 UTC | #3
It's working well !
Thanks Gurwan !
system | 2020-02-03 15:33:28 UTC | #4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 6819