在所有虚拟服务器中验证用户

Authenticate user inside all virtual servers

我在 glassfish 上有大约 5 个虚拟服务器,我将在所有虚拟服务器中对用户进行身份验证,但任何虚拟服务器都有单独的会话 ID。 我怎样才能做到这一点? 什么是 JSESSIONIDSSO,它能解决我的问题吗?

http://v1.localhost:81 => sessionID=7f60cc7076f690b365d85cff0a45
http://v2.localhost:81 => sessoinID=7b6d35dd17cbb05982ef769a12f7

我不是专家,你可以考虑Apache Shiro and CAS
有类似问题可能对你有帮助。
How to implement single sign on across multiple JVM based applications using Spring Security

Single Sign On [SSO] across different domains using Java

带缓存的 Shiro 会话集群可以帮助您解决这种情况。会话将由 shiro 使用集群缓存进行管理。 一个例子是: https://github.com/stormpath/shiro-hazelcast-web-sample