从AJP连接器请求中检索Shibboleth属性

问题描述 投票:2回答:1

我在使用在Apache上运行的Shibboleth身份验证时遇到了一个奇怪的问题,当Tomcat7在后端运行时,Apache通过mod_proxy_ajp发送所有内容。所以它与Shibboleth的参数有关。

documentation中明确声明AJP仅发送带有前缀attributePrefix="AJP_"的属性,开发人员不应该使用快捷方式并通过HTTP头发送auth属性:https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPSpoofChecking

我尝试使用检索属性

HttpServletRequest req = (HttpServletRequest) FacesContext.getCurrentInstance()
                         .getExternalContext().getRequest();

Enumeration<String> e = req.getAttributeNames();

但无论我尝试什么,都不会出现任何Shibboleth属性。

java apache tomcat7 shibboleth ajp
1个回答
4
投票

经过两个小时试图找出我做错了什么。我尝试使用名称检索属性。

req.getAttribute("uid");

由于某种原因,这是有效的。即使"uid"未在getAttributeNames()中列出;

它闻起来像是一个bug,或者是AJP和Spring或JSF之间的错误沟通......

© www.soinside.com 2019 - 2024. All rights reserved.