How to authenticate one application using another application when both applications use the same backend server

I have a Rails application using it as a backend and two angular 2 applications (Admin application and main application). Both applications use the same server.

When I log into the Admin application, it will display a list of users. Now what I want to achieve is to click on any user who should enter the main application with this user without asking for authentication.

The problem I get is that when I request the Admin application for the Rails server, I log in from this user and reply back to the Admin application, I want to open the main application in a different tab for this user without closing the admin application. I am stuck on how to send a response to an Admin application request in the main application so that I can open the application.

If I can set the user data in localstorage of the main application, I think this will solve the problem.

Please suggest me any other way if I go in the wrong direction

+4
source share

Source: https://habr.com/ru/post/1688677/


All Articles