I am currently implementing a react application where there is the main application where the authentication takes place and then there is a sub-application that has a different URL and gets opened in a separate window based on user selection and the user should be validated as logged in if the authentication already happened in the main app. If the user tries to directly access the sub app from the URL , they should be redirected to the main login if the user is not authenticated from the main app. How can this be done? Is there any way to share the loggedIn info to the sub app also in some way?
CodePudding user response:
you should implement a Single sign-on (SSO). It's an authentication scheme that allows a user to log in with a single token to several systems. You can implement such system via OpenId Connect.
CodePudding user response:
In the login you can create a JWT token (https://jwt.io/) to send in the header, and in the other websites you can check it.
You can check the signature and the content with the required data.