0
votes

I'm still a learner, please forgive me if I ask a simple question. I have an application which contains its own users table where I store the email and password. When the user logs in I store the user's information (without the password) in session and privilege IDs (so that I can manage who gets to see each page after the login).

I integrated a Cognito login. How should the integration with the existing users table work? After a successful Cognito login I get a token back. Can someone write me how do I integrate the Cognito token with existing users table? Any thoughts are appreciated.

1

1 Answers

1
votes

Cognito returns a JWT token which can be decoded via libraries like https://jwt.io/

The output will be somewhat like

Decoded Cognito Token

For your use case use "cognito:username" to identify the user and store an event against it