Accessing Attributes from LoginHandler via attribute-resolver.xml

Paul Hethmon paul.hethmon at clareitysecurity.com
Thu Dec 20 15:08:03 EST 2012


Etan

I do this and had to create a custom principal to hold the info. The login handler pushes the data into it during authentication. Then I have a separate data resolver that pulls the info out as attributes during that phase. So the principal is my data transport between the two distinct plug ins.

Paul


(This phone has more cpu power than my first several computers, combined)

On Dec 20, 2012, at 11:59 AM, "Etan Weintraub" <eweintra at jhmi.edu<mailto:eweintra at jhmi.edu>> wrote:

Hi all-
So, I’ve been googling and searching the mailing list for a bit with minimal look, and figured it was about time for me to give up and ask for help.

Anyway, we’re developing a custom login handler for a project, and it will pretty much be the only way for us to get attributes about the user (the data store we are using isn’t something we can access over LDAP or SQL). The login handler plugin should be able to return them in the requestContext, which I know I could probably use somewhere in the DataConnector pieces, but I need to use it in the AttributeDefinition piece instead. For example, let’s say parallel to principalName it returns another value “fullName”. I’d like to do something like the following, but it doesn’t work:

    <resolver:AttributeDefinition xsi:type="Script" xmlns="urn:mace:shibboleth:2.0:resolver:ad" id="EtanFullName" >
     <Script><![CDATA[
      importPackage(Packages.edu.internet2.middleware.shibboleth.common.attribute.provider);
      EtanFullName = new BasicAttribute("EtanFullName");
      EtanFullName.getValues().add($requestContext.fullName);
     ]]></Script>
    </resolver:AttributeDefinition>

I get the following error (trimmed up a bit for here) in the idp-process.log:

12:37:24.988 - ERROR [edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.attributeDefinition.ScriptedAttributeDefinition:135] - ScriptletAttributeDefinition EtanFullName unable to execute script
com.sun.phobos.script.util.ExtendedScriptException: org.mozilla.javascript.EcmaError: ReferenceError: "$requestContext" is not defined. (<Unknown Source>#3) in <Unknown Source> at line number 3

Any ideas?

Thanks in advance.

-Etan E. Weintraub
Sr. Systems Engineer
Directory Architecture
IT at Johns Hopkins
Johns Hopkins at Mt. Washington
5801 Smith Ave.
Suite 3110B
Baltimore, MD 21209
Phone: 410-735-7945
E-mail: eweintra at jhmi.edu<mailto:eweintra at jhmi.edu>

--
To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net<mailto:users-unsubscribe at shibboleth.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/users/attachments/20121220/f0b4fbd0/attachment-0001.html 


More information about the users mailing list