Friday, 10 March 2023
  7 Replies
  883 Visits
  Subscribe
Hi all

I've downloaded the sgccognito_idp_demo and I'm trying the Initiate Auth method.

I have a working example in Postman, so I copied the relevant values into the demo fields (URL, Access Key, Client Secret) but when I paste the body data into the "Body" memo field I'm getting a 400 Bad Request error: 'HTTP/1.1 400 Bad Request. {"code":"BadRequest","message":"The server did not understand the operation that was requested.","type":"client"}'.

I'm wondering if the text in the Body memo needs some kind of special formatting.
1 year ago
·
#1437
Hi,

Which method are you using? if you are using a POST method, the body must be encoded as form url encoded, example:

param1=value1&param2=value2...

Kind Regards,
Sergio
Yes, it's indeed a POST method.

The endpoint is: AWSCognitoIdentityProviderService.InitiateAuth

The body is a JSON string that looks like this:

{
"ClientId": "...",
"AuthFlow": "USER_PASSWORD_AUTH",
"AuthParameters": {
"USERNAME": "...",
"PASSWORD": "..."
}
}

How can I put the nested values in the format you said?
1 year ago
·
#1443
Hi,

First sorry because my previous response was wrong, after reviewing the documentation, the cognito api doesn't make use of the form url encoded, so you are right, it's a json string the text that must be sent in the body of the post request.

I've compiled the demo sample for cognito, with a fix for this error and you can download from:

https://www.esegece.com/download/samples/cognito.zip

Please try with this demo if the json text works for you, if works, I can provided an updated trial with this fix included.

Kind Regards,
Sergio
Yes, it's working!

Please let me know when you add the fix to the trial.
1 year ago
·
#1446
Hello,

You can download the trial with the fix from the following link:

https://www.esegece.com/download/samples/sgcOpenAPI_Amazon_Trial_fix.zip

Kind Regards,
Sergio
1 year ago
·
#1447
Hi, Sergio

My company just purchased the Amazon OpenAPI product.

I've encountered again the original error.

Is this fixed in the official release or just in the trials?
1 year ago
·
#1448
Hello,

The latest release doesn't include this fix, but you can download the latest sgcOpenAPI Amazon beta 2023.3.0 which includes this fix.

Kind Regards,
Sergio
  • Page :
  • 1
There are no replies made for this post yet.
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below.
Supported: gif,jpg,png,jpeg,zip,rar,pdf
· Insert · Remove
  Upload Files (Maximum 10MB)