assigning eduperson based on memberof

Peter Schober peter.schober at univie.ac.at
Fri Jul 12 06:50:46 EDT 2013


* Morris, Andi <amorris at cardiffmet.ac.uk> [2013-07-12 12:09]:
> Time to brush up on my scripting.

With something like the following I was able to test/exercize
JavaScript-based Script-type AttributeDefinitions outside the
Shibboleth IdP (and by using a copy of the IdP's lib folder also on a
completely different machine), which eases development significantly
when you need many write/save/execute cycles to determine what works.

$ java -cp "/usr/share/java/*:/opt/shibboleth-idp/lib/*" \
 org.mozilla.javascript.tools.shell.Main -w -strict -f foo.js

Your foo.js then starts with the usual imports...

importPackage(Packages.edu.internet2.middleware.shibboleth.common.attribute.provider);
importPackage(Packages.org.slf4j);
importPackage(Packages.org.joda.time);

Instead of instantiating LoggerFactory.getLogger I simply have "print"
statements in the script, which I change to logger.debuog or whatever,
or remove completely when moving things into the IdP and into
production.

You can define/simluate attributes your Script depends on locally, e.g.:

var schacDateOfBirth = new BasicAttribute("schacDateOfBirth");
schacDateOfBirth.getValues().add("19690401");

so that you can properly test for specific (or no) values.

HTH,
-peter


More information about the users mailing list