当我在 Apache 上运行 Shibboleth 身份验证时遇到了一个奇怪的问题,当 Tomcat7 在后端运行时,Apache 通过 mod_proxy_ajp 发送所有内容。对于来自 Shibboleth 的参数也是如此。
在 documentation明确指出 AJP 仅发送带有前缀 attributePrefix="AJP_"
的属性,并且开发人员不应走捷径并启用通过 HTTP header 发送身份验证属性:https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPSpoofChecking
我尝试使用检索属性
HttpServletRequest req = (HttpServletRequest) FacesContext.getCurrentInstance()
.getExternalContext().getRequest();
Enumeration<String> e = req.getAttributeNames();
但无论我如何尝试,都没有出现任何 Shibboleth 属性。
最佳答案
经过两个小时的努力找出我做错了什么。我尝试使用以下名称按名称检索属性。
req.getAttribute("uid");
出于某种原因,这是可行的。即使 "uid"
未在 getAttributeNames();
它闻起来像是一个错误,或者是 AJP 和 Spring 或 JSF 之间的不合时宜的通信......
关于java - 从 AJP 连接器请求中检索 Shibboleth 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18164141/