简体   繁体   中英

Can I use AWS Cognito token(s) to verify users across applications?

I have multiple applications such as:

  1. user.myappsite.com/app1
  2. user.myappsite.com/app2
  3. user.myappsite.com/app3

A user logs in using their cognito login on any given application. Problem is if they go to another application they have to log into that one as well. I'd like to use a token created at login to verify the user on other apps so they don't have to login multiple times.

I'm sure this is possible but not finding anything helpful through the docs or searching.

Depends on how your app is constructed. The issue is you need to store the login state somewhere in your application. If you are using an SPA you need to use a store. If this app has a server involved you can use server side sessions.

In the case of a server whenever the user visits a page you need to verify that they have a valid session before proceeding.

In the case of an spa you only need to verify once when the page initially loads and prevent your app from rendering unless that token exist.

Keep in mind with an spa your apps insides are all exposed so make sure any sensitive information your app provides only comes from a place that verifies tokens first (like api gateway).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM