Skip to Content.
Sympa Menu

shibboleth-dev - Re: [Shib-Dev] custom data resolver

Subject: Shibboleth Developers

List archive

Re: [Shib-Dev] custom data resolver


Chronological Thread 
  • From: Paul Hethmon <>
  • To: Shibboleth Dev <>
  • Subject: Re: [Shib-Dev] custom data resolver
  • Date: Thu, 19 Aug 2010 18:03:23 -0400

On 8/19/10 5:53 PM, "Chad La Joie "
<>
wrote:

>> I'll dig through the classes/methods again to see if I can find that link,
>> its eluded me thus far.
>
> Which link? accessing the Session from the request context? Or the
> LoginHandler javadoc?

I've read the LoginHandler javadoc, so that one is ok. The part I can't find
way to get to the session information is from the DataConnector class:

public class AuthDataConnector extends BaseDataConnector {
public Map<String, BaseAttribute> resolve(ShibbolethResolutionContext
resolutionContext)
throws AttributeResolutionException {

try {
SAMLProfileRequestContext ctx =
resolutionContext.getAttributeRequestContext();
Session s = ctx.getUserSession();
String sid = s.getSessionID();

// The principal name is the index into our storage engine
Object o = AuthDataStorage.get(ctx.getPrincipalName());
if (o == null) {
LOG.debug("[{}]. Principal name not found.",
ctx.getPrincipalName());
attributes = new HashMap<String, BaseAttribute>(0);
return attributes;
}

So using the info from the wiki, I created my class extending
BaseDataConnector. During attribute resolution, I get the
ShibbolethResolutionContext object. As in my code snippet above, I can get
to the Session. Maybe this is where I'm missing it. I see I can do a
Session.getSubject, so would that be where my custom login handler would
insert the data from the authentication process? For simplicity right now, I
just created a custom class with a static storage in it.

Paul




Archive powered by MHonArc 2.6.16.

Top of Page