Liferay 具有多个子域和 CAS
我们已成功将 Liferay 门户配置为具有映射到不同子域(即 test1.domain.com、test2.domain.com)的多个组织。
当我们在 Liferay 中启用 CAS 时,问题就出现了。 CAS 服务器位于 www.domain.com。我们注意到,当您尝试登录其中一个子域(例如 test1.domain.com)时,它会重定向到 CAS,然后 CAS 重定向回 Liferay。但是,它不会重定向回 test1.domain.com,而是重定向回 www.domain.com。看起来当 Liferay 最初重定向到 CAS 时,它并没有发送子域作为服务 URL 的一部分,而是发送 www.domain.com 作为服务 URL。
我知道您可以在 Liferay 中设置 CAS 服务 URL,但我们需要它根据您尝试登录的 Liferay 组织/子域而动态变化。因此,如果您登录到 test1.domain.com,发送到 CAS 的服务 URL 将类似于 service=http://test1.domain.com
有什么想法吗?
We've successfully configured the Liferay portal to have multiple organizations that are mapped to different sub-domains (i.e. test1.domain.com, test2.domain.com).
The problem arises when we enable CAS within Liferay. The CAS server lives on www.domain.com. We noticed that when you try to login to one of the sub-domains (such as test1.domain.com), it redirects to CAS, and then CAS redirects back to Liferay. However, instead of redirecting back to say test1.domain.com, it redirects back to www.domain.com. It looks like when Liferay initially redirects to CAS, it's not sending the sub-domain as part of the service URL and is instead sending www.domain.com for the service URL.
I know you can set the CAS service URL within Liferay, but we need it to be dynamic based upon which organization/sub-domain of Liferay you're trying to log into. So that if you're logging into test1.domain.com, the service URL sent to CAS will be something like service=http://test1.domain.com
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以创建钩子修改
CASFilter.Class
扩展BaseFilter
You could create hook modify
CASFilter.Class
extendsBaseFilter
您可以修改 com.liferay.portal.servlet.filters.sso.cas.CASFilter,或基于它创建您自己的过滤器。
服务 url 是在 processFilter 方法中构造的,您可以更改它不使用配置中的“服务 URL”,而是根据传入请求属性(架构、服务器名称等)构造它。
You could modify com.liferay.portal.servlet.filters.sso.cas.CASFilter, or create your own filter based on it.
Service url is constructed in method processFilter, there you can change that it doesn't use "Service URL" from configuration, but construct it based on incoming request properties (schema, serverName, ...).