user2868835
user2868835

Reputation: 1600

How to apply Spring Security for multiple Spring Boot packaged web apps

I'm in the process of converting a Tomcat deployed web app to a Spring Boot packaged web UI. The original Tomcat WAR used Spring Security to secure URL's exposed by the web app. Within a short while I will be developing a second web app that will be deployed as a second discrete Spring Boot app.

Before using Spring Boot I would probably have encapsulated both web apps into a single WAR file using Spring Security to secure the URL's of both.

However, given that that there are now two distinct JAR's deployed onto two distinct servers, how do I apply a common Spring Security model? If a user is authenticated on web app #1 then I want that authenticated state to be recognized by web app #2, to avoid the user having to login again.

To reduce inter dependence should I configure each Spring Boot app to employ the same underlying Spring Security configuration? Or is there a different appraoch required?

Upvotes: 3

Views: 1745

Answers (1)

Nikhil
Nikhil

Reputation: 83

An excellent article for your problem at https://spring.io/guides/tutorials/spring-security-and-angular-js/

You have to use @EnableRedisHttpSession and @EnableZuulProxy annotations.

Upvotes: 1

Related Questions