Amazon Cognito
Amazon Cognito Auth Demo

This sample web page demonstrates how to use the Amazon Cognito Auth SDK for JavaScript with Authorization code grant flow. To learn more see Developer Guide.

Note : When you creating Cognito app clinet make sure to unckeck the Generate client secret checkbox.

This sample will initialize a CognitoAuth object and initiate the sign up / sign in flow. You will need to substitute your own Cognito User Pool configuration values to make it work. Look at the source for this page and read the comments to learn more. You can also view the README.md of this sample page and the README.md of the Cognito Auth JavaScript SDK.


Sign-In to Continue

You have Signed-In

Get new Id token and Access Token using current Refresh Token
Refresh Token
Show Cached Tokens in the local Storage

Once you sign in, close the browser without sign out.
Then reload the page and click on the Show Cached Button.
You can get your previous tokens from the local storage.

Show Cached Session

_


Tokens

Id Token

 ... 

Access Token

 ... 

Refresh Token

 ... 

Photo Album Viewer