I look for the Authorization token used by Cognito in order to put it in the header of my tests. I need to test some backend API.
I am using Insomnia and the awscognitotoken plugin. However, I fail to configure it in order to get the token. Their usage is not clear to me.
Here is how I configure the awscognitotoken plugin :
- Function to Perform: AWS Cognito Team - Plugin for insomnia ………
- Username: the email I use to login to cognito; also tried the cognito username (uuid)
- Password: the password
- Region:
eu-west-1 - ClientId:
3t********************dcl5 - TokenType:
access - ClientSecret: nothing as none is configured
What I get is:
Error in getting session:
{ "request":
{ "method":"post",
"headers":{
"content-type":"application/x-amz-json-1.1",
"x-amz-target":"AWSCognitoIdentityProviderService.InitiateAuth"
},
"body":"{\"AuthFlow\":\"USER_PASSWORD_AUTH\",\"ClientId\":\"3t***dcl5\",\"AuthParameters\":{\"USERNAME\":\"myemail@example.com\",\"PASSWORD\":\"<password>\"}}"},
"status":400
}
Can you spot any error?