# How to get a new access token using AWS Cognito CUSTOM\_AUTH flow?

**URL:** <https://community.postman.com/t/how-to-get-a-new-access-token-using-aws-cognito-custom-auth-flow/68923>\
**Category:** Help Hub\
**Tags:** authentication, access\_token, aws\
**Created:** [September 26, 2024, 1:07pm UTC](https://community.postman.com/t/how-to-get-a-new-access-token-using-aws-cognito-custom-auth-flow/68923 "2024-09-26T13:07:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nobau](https://avatars.discourse-cdn.com/v4/letter/n/f475e1/32.png) [@nobau](https://community.postman.com/u/nobau)\
**Post date:** [September 26, 2024, 1:07pm UTC](https://community.postman.com/t/how-to-get-a-new-access-token-using-aws-cognito-custom-auth-flow/68923/1 "2024-09-26T13:07:16Z")

</div>

In my app, I have created a passwordless CUSTOM\_AUTH flow for AWS Cognito. This means that the user enters their email in the app and then receives an OTP in their inbox which is then entered in the app. The app receives an ID token, a refresh token and an access token from AWS Cognito.

Alternatively, I can also use the AWS CLI with the two commands:  
` **aws cognito-idp initiate-auth --auth-flow CUSTOM_AUTH --auth-parameters USERNAME=<email> --client-id <Cognito App Client ID>** `

` **aws cognito-idp respond-to-auth-challenge --client-id <Cognito App Client ID> --challenge-name CUSTOM_CHALLENGE --session "<Session>" --challenge-responses USERNAME=<email>,ANSWER=<Code received via email>** `

I’m testing my REST API with Postman, but it’s annoying for me to always have my demo app get an access token and then copy it into Postman (Bearer Token).

I’m wondering how I can configure Postman to follow the passwordless CUSTOM\_AUTH flow with OTPs. Or alternatively, that I can at least insert the refresh token so that Postman can get itself an access token.

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [October 26, 2024, 1:07pm UTC](https://community.postman.com/t/how-to-get-a-new-access-token-using-aws-cognito-custom-auth-flow/68923/2 "2024-10-26T13:07:55Z")

</div>

Closed on October 26, 2024, 1:07pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
