User Attributes in Java

Peter Schober peter.schober at univie.ac.at
Tue Jan 26 03:51:13 EST 2016


Please send support requests to the mailing list.

* yangyi0318 at hotmail.com <yangyi0318 at hotmail.com> [2016-01-26 04:44]:
> I read your thread about getting attributes in Java.

You'll need to be more specific. I'll try to guess at a a few issues
below, but why not provide the relevant info up front?

> I am having the same issue these days. I am coding a filter, the
> filter will do something is the user is authenticated (by checking
> loginContext.isUserAuthenticated). If the user is authenticated, I
> need to retrieve the user attributes, but I couldnt get them from
> req.getAttribute nor req.getHeader. What was your solution to this
> problem?

What "same issue" and ""this problem"?
Are you referring to those messages from 2010 I referenced here?
http://shibboleth.net/pipermail/users/2015-June/022264.html
That issue was one of not seeing attributes set by the Shibboleth SP
when iterating over request.getAttributeNames() in Java.
Etienne has provided the most complete answer to date:
http://shibboleth.net/pipermail/users/2015-June/022268.html
In short, you'll need to explicitly request any attributes set via AJP
by name, not look for them by iterating over those objects.

But since you write about not getting them via req.getAttribute()
-- not request.getAttributeNames() -- that's not the same issue at
all, if you're indeed asking for specific attributes by name (which is
impossible to tell from your incomplete examples).
That's probably just a misconfiguration of your Java servlet container
and/or web server and/or everything before that: could be that the
SAML IDP not releasing those (unspecified) attributes, or the SP not
accepting them, or the SP not prefixing them with 'AJP_', etc.).
That's all one can say based on the lack of technical details provided.
-peter


More information about the users mailing list