Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cognito authentication and Single Sign On

I have a web page were the user signs in using Amazon Cognito and AWS Amplify authentication. I have a link into that application that opens another aplication. I want a Single Sign On (I'm not sure if this is the best way to do this), however, I have read a little about it, that there is information about getting the ID Token and the Access Token to login to the other application. How can I use that JWT token to access to my application? The expected result

like image 756
Angelica Luna Avatar asked Sep 06 '25 17:09

Angelica Luna


1 Answers

After authentication, your application can query tokens from Cognito User Pool (see https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html)

Your app can, in turn, pass a token to the second app (the target of the SSO) as a HTTP header.

The second app will verify the token (i.e. verify the signature and the claim, see https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-verifying-a-jwt.html) and grant access to authorised users.

In case no token is provided, or an invalid token, the second app will redirect to an authentication page.

like image 178
Sébastien Stormacq Avatar answered Sep 10 '25 01:09

Sébastien Stormacq