Sharing security context between few web applications

前端 未结 2 1297
长情又很酷
长情又很酷 2020-12-17 02:14

I need to have web application which actually consist from few separate wars unified into same navigration bar on UI, i need to have all system secured but have authenticati

相关标签:
2条回答
  • 2020-12-17 02:41

    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.

    0 讨论(0)
  • 2020-12-17 02:50

    Spring Security stores the login data in the http session. So what I would try is to share the session between the applications.

    It seams that this is possible (in Tomcat) by using the Single Sing On attribute.

    But be warned, sharing the session between two applications is not without danger. See this Stack Overflow question.

    0 讨论(0)
提交回复
热议问题