Answer the question
In order to leave comments, you need to log in
Spring Security - how to do single sign-on?
Hello!
The question is as follows. I have a Spring web project that provides REST WS, in fact it is a server, it has all the logic, and there are two more web applications that work with the first one.
As a result, there are two client applications and 1 server.
How to make it so that when logged in in one client, the second one pulls up the session and is also logged in?
Answer the question
In order to leave comments, you need to log in
Well, generally speaking, REST implies statelessness - each request must contain information that identifies the user (basic, digest auth). Those. your client application EACH TIME inserts authentication data (login/password) into the request header, and the application "lifts" the user from the database using this data and returns the result / denies access depending on the role.
The second option is to use token-based authentication/authorization (see OAuth, JWT (JSON Web Tokens))
The third option is to use cookies, and this may be justified in your case. If both clients work for you on the same domain / subdomain, then with a cookie everything will turn out quite simply
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question