This can be achieved by following approach. In Spring, SecurityContext
by default is stored in HttpSession
. Instead you can configure it to store in some shared repository.
So, configuration should be changed to use your own SecurityContextRepository
implementation instead of HttpSessionSecurityContextRepository
. Once configured, the security framework will look at the Repository
which is available to all your web applications.
The Repository
can be either a database or a cached server.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…