I am trying to consume AWS Cognito (User Pool) REST APIs in the Postman. I kind of found the Cognito API documentation but I don’t know how to consume this in postman. I am a newbie. I don’t have any idea what would be the endpoint URL to call the AWS Cognito API.
Actually, I want to directly consume the Cognito REST API and don’t want to use Cognito signIn pop-up. It should directly signIn the user.
Kindly guide how I can achieve this?
2
Answers
You cannot consume Cognito APIs directly within Postman, because you’ve to configure AWS credentials, Cognito UserPool ID and App client ID in order to authenticate with cognito, so to make this process easy you can either use AWS CLI or AWS SDK for your preferred language e.g. JavaScript, Python, etc.
Here’s an example of AWS Cogito SDK for JavaScript
https://www.npmjs.com/package/amazon-cognito-identity-js
To sign in using AWS Cognito, use a given AWS SDK such as .NET, Java, or Python. The latest AWS Cognito SDK examples can be found in the Code Library. See this example that peforms a sign in use case in different programming languages.
Sign up a user with a user name, password, and email address.
Confirm the user from a code sent in email.
Set up multi-factor authentication by associating an MFA application with the user.
Sign in by using a password and an MFA code.
Sign up a user with an Amazon Cognito user pool that requires MFA using an AWS SDK