Seanimus
Seanimus

Reputation: 567

How to get the User pool token from Hosted UI on AWS Cognito

I am wanting to use the Hosted UI option in AWS Cognito so I don't have to build my own login page.

Most Cognito examples I see include custom built login pages using the Amplify-js framework. I'm trying to avoid this approach.

For my project, I have selected the Hosted UI option in AWS Cognito and upon successful login, I am redirected to my React application. However I'm unaware of how to retrieve the user pool token at this point. Looking in my chrome developer tab, I don't see any tokens under local storage, session storage, cookies, etc.

How can I find this token?

Upvotes: 5

Views: 3294

Answers (1)

Jishnu
Jishnu

Reputation: 474

The token is returned as a query parameter id_token while redirecting to your application. Refer to the docs for more details: using the hosted UI

Upvotes: 3

Related Questions