leftyloosie
leftyloosie

Reputation: 528

AWS Cognito - API (not SDK) - Basic sign up

I have to use the Cognito API (not coding in a language with an SDK). I was using Fiddler to just test out a recently created User Pool and user sign up, but I keep getting:

HTTP/1.1 400 Bad Request x-amzn-ErrorType: UnknownOperationException.

Can someone point me in the right direction?

I feel like my URL could be wrong and/or the User Pool ID needs to be included somewhere.

POST https://cognito-idp.us-west-2.amazonaws.com/ HTTP/1.1

CONTENT-TYPE: application/x-amz-json-1.1
X-AMZ-TARGET: com.amazonaws.cognito.identity.idp.model.AWSCognitoIdentityProviderService.Signup
HOST: cognito-idp.us-west-2.amazonaws.com

{
"ClientId": "##################", //App client id. The app associated with the User Pool
"Password": "98765432", //min length 8, requires numbers...JUST FOR TESTING
"UserAttributes": [ //email and name are the only attributes for this pool...JUST FOR TESTING
{
"email": "###########", //an email address
"name": "Joe" //user's name
}
],
"Username": "testName987" //the user name
}

It appears some people have gotten through this basic step, as shown here and here, but I'm struggling with this first step.

TIA

Upvotes: 1

Views: 1384

Answers (1)

Ionut Trestian
Ionut Trestian

Reputation: 5751

Here is the successful request I am making:

POST / HTTP/1.1
Host: cognito-idp.us-east-1.amazonaws.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
X-Amz-User-Agent: aws-sdk-js/2.6.4
Content-Type: application/x-amz-json-1.1
X-Amz-Target: AWSCognitoIdentityProviderService.SignUp
X-Amz-Content-Sha256: b2c2b342a0b689bf895aa960ebcf183b633f7ece15725c1807de9ecba005f51d
Content-Length: 244
origin: null
Connection: keep-alive

Note the request is a POST and the X-Amz-Target: AWSCognitoIdentityProviderService.SignUp. The parameters for the request are passed as JSON.

Upvotes: 2

Related Questions