简体   繁体   English

shibboleth idp获取用户属性

[英]shibboleth idp get user attributes

I am making a plugin (in JAVA) for shibboleth idp. 我正在制作shibboleth idp的插件(在JAVA中)。 In the plugin, I need to get the user's attributes if the user is authenticated. 在插件中,如果用户经过身份验证,则需要获取用户的属性。 I use a Filter (pattern /profile/*) to process the request, but none of the user attributes is stored in the request's attributes or header, how could I retrieve the user's attributes in Java code if the user is authenticated? 我使用过滤器(模式/ profile / *)来处理请求,但是没有用户属性存储在请求的属性或标头中,如果用户通过了身份验证,如何在Java代码中检索用户的属性?

You have to open your AJP port in your application server. 您必须在应用程序服务器中打开AJP端口 Attributes will be sent out to only those pages where AJP is enables. 属性将仅发送到启用AJP的那些页面。 (you may want to add attributePrefix="AJP_" to your conf file.) (您可能想将attributePrefix="AJP_"添加到您的conf文件中。)

You need to add following to your proxy server (considering AJP port is open on 8009) 您需要向代理服务器添加以下内容(考虑到AJP端口已在8009上打开)

ProxyPass /profile/* ajp://localhost:8009/profile/* ProxyPass / profile / * ajp:// localhost:8009 / profile / *

Even if this is done, shibboleth parameters won't display directly under parameters.keySet() . 即使这样做,shibboleth参数也不会直接显示在parameters.keySet() But if you do parameters.get(key) then it will return some value sent by shib. 但是,如果执行parameters.get(key) ,它将返回shib发送的一些值。

Above behaviour may vary for different servers; 对于不同的服务器,上述行为可能有所不同; ie you may need to get values by parameters.get("AJP_"+key) . 也就是说,您可能需要通过parameters.get("AJP_"+key)获取值。 PS check in both header and request object. PS检入标头和请求对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM