One login for 2 different angular apps on different domains

Viewed 79

I want to create one login page for 2 already developed angular applications. They both use the same db and backend. An example: A user of site A comes to the login page and is redirected to the site A, then a user of site B uses the same login page to login and is redirected to site B, a different domain. Meaning after authentication each is redirected to A.com and B.com respectively.

I have considered SSO but this requires a user accessing site A first, then they are prompted to login and then granted access which means a user for site B would have to access site B to be able to access it. This did not give me the functionality i wanted.

I tried redirecting with an encrypted token to the respective site a user wants to access but the encrypted token, encrypted from the backend, is too long the angular routing throws an error.enter image description here

Is what am trying to do possible, if so how can I approach it.

0 Answers
Related