Getting Access Token from Amazon Cognito using Postman | Authorization Code Grant and Implicit Grant
ฝัง
- เผยแพร่เมื่อ 30 มี.ค. 2023
- In this video, I will show you, how to retrieve Access Token and ID Token from Amazon Cognito using Postman with authorization code flow as well as implicit grant flow.
Notion link - www.notion.so/Getting-Access-...
Additional Watch
📺Building Serverless .NET APIs using AWS Lambda, Amazon API Gateway, and Amazon Cognito • Building Serverless .N... - วิทยาศาสตร์และเทคโนโลยี
Thanks man, I have been trying to understand this since morning and your video made it so simple. You rock!
Very usefull Video, thank for shared it!
Good video, thanks!
Can I ask if can I use this to connect on google api services? google calendar api to be specific btw I used nextjs as framework + aws as backend I also used google social login.
You are the man
How to get the BearerToken / Access Token without sign-in step? for example to be used in Test automation (or pipeline jobs running on CI/CD)
In that case, you need to use Client Credentials flow.
Thanks for the video. I ran into this trying to see if there is a way to automate the entire process. Do you know any tutorials that show if this is possible to do all of this programmatically without any user interaction?
Yes, this is a two-step process: first, create a Cognito user pool, and then configure Postman to generate bearer tokens.
To begin, you can utilise IaC scripts such as CDK, Terraform, CloudFormation, and others to automate the formation of a Cognito user pool.
Second, for the Postman section, you'll have to initially configure it manually, and when doing so, try to utilize variables rather than hard-coded values whenever possible. The collection and variables can then be exported to JSON files. You can later utilize those files to easily configure the environment.
Hope this should help!
Very helpful video but I fail to understand what should i do if I don't want to authorize using the UI. I just created a user and I simply want to retrieve the access token in postman without using the UI
If you are not using Hosted UI, then you can use Cognito's Authentication Flows instead of OAuth flow. Answers on this page can help you. repost.aws/questions/QUW-FCbWmbRSSRQnfgQEdefg/how-do-i-obtain-an-id-token-from-cognito-without-hosted-ui
How Do I get the token from my real app without postman, using authorize code grant?
Depends on what framework you’re using for the web app.
First i want to access token to get into cognito user pool ther I want to get cognito token and thorugh which I want to use services like S3 bucket, How can I do it?
For that you have to create a Cognito Identity Pool, and then have to call assume-role-with-web-identity API method. Refer to this detailed post - repost.aws/knowledge-center/cognito-identity-pool-grant-user-access
Does it give new access token every time or the same ?
It should give a new one every time I believe. But you can verify.