我正在尝试将Shibboleth身份验证与我继承维护的旧Struts-1应用程序集成在一起,但我不知道如何访问Shibboleth属性。
这是我尝试过的:
public final class AuthenticateAction extends MappingDispatchAction {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
Enumeration attributeNames = request.getAttributeNames();
while (attributeNames.hasMoreElements()) {
String attributeNm = (String) attributeNames.nextElement();
System.out.println("DEBUG: " + attributeNm);
}
String eppn = (String) request.getAttribute("eppn"); // <-- Null 在遍历上面代码中的属性名称时,我所期望的Shibboleth属性都没有打印出来。
如何访问Shibboleth属性?
发布于 2013-07-16 04:33:47
事实证明,在我的例子中,这是服务器端配置的问题。
遵循这里的说明:https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPJavaInstall之后,我能够简单地获得属性:
String eppn = (String) request.getAttribute("eppn"); // <-- no longer null
https://stackoverflow.com/questions/17577547
复制相似问题