Shibboleth SP - 从 Java 读取断言属性 [英] Shibboleth SP - Reading assertion attributes from Java

查看:21
本文介绍了Shibboleth SP - 从 Java 读取断言属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道默认情况下配置的属性将存储为环境变量,并且可以像

I understand that configured attributes will be stored as environment variables by default and will be accessible like

request.getAttribute("Shib-Identity-Provider")

我试过了,经过一些谷歌搜索后,我明白可以通过 AJP 在 Java 中访问它们.

I tried that and after some googling I understood that to access them in Java through AJP.

我需要加前缀

<ApplicationDefaults id="default" policyId="default"
    entityID="https://idp.example.org"
    REMOTE_USER="eppn persistent-id targeted-id"
    signing="false" encryption="false" attributePrefix="AJP_">

我这样做了,但我的 Java 应用程序仍然为空

I did that but I still keep getting null in my Java application

  • Shib-Identity-Provider - 空
  • Shib-Session-ID - 空
  • Shib-Application-ID - 空

有人可以帮我弄清楚我缺少什么以使其正常工作吗?

Could someone help me figure out what I am missing to make it work?

推荐答案

  1. 确保您的属性映射文件中有此字段.

  1. Make sure you have this field in you attribute map file.

1.1 而且 idP 也必须发送属性.

1.1 And idP has to send the attribute too.

由于您的属性前缀为AJP_",因此您的属性将变为AJP_attributeName"(这也可能有所不同)

Since you have attribute prefix as "AJP_" your attributes will be coming as "AJP_attributeName" (This can vary too)

2.1 您必须打开通常侦听 8009 的 AJP 端口并将/secure 路径重定向到 AJP.您必须在 apache 中执行此操作才能将代理转发为 AJP.

2.1 You have to open up your AJP port which usually listens on 8009 and redirect the /secure path to AJP. You have to do this in apache to forward proxy as AJP.

2.2 在/secure 路径的 servlet/处理程序中,尝试将属性设为 request.getHeader("AJP_attrName").

2.2 In your servlet/handler of /secure path try getting attribute as request.getHeader("AJP_attrName").

(如果这不起作用,也可以尝试以下 a. reqest.getAttribute("attr") b. reqest.getAttribute("AJP_attr") c. header.getAttribute("attr") c. header.getAttribute("AJP_attr").我告诉你试试这个,因为我很久以前就做过这个,我我不确定确切的方法.)

(Can try following too if this does not work a. reqest.getAttribute("attr") b. reqest.getAttribute("AJP_attr") c. header.getAttribute("attr") c. header.getAttribute("AJP_attr"). I am telling you to try out this because I have done this long time ago and I am not sure about exact method.)

这篇关于Shibboleth SP - 从 Java 读取断言属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆