Extracting Values from a Custom Principal
cneberg
cneberg at gmail.com
Thu Feb 11 19:57:31 EST 2016
Scott as we discussed earlier today. Something like the code below would
have been very useful getting attributes values out of a custom subject
class it would have cut down on custom javascript considerably.
1) Required: PrincipalClass: What principal class to extract out of
the subject. If there are multiple matches this logic will be called
multiple times once per instance. Assumes Principal also has an
interface which allows get(String), and Set<String> getKeys().
2) Optional: resultPrefix would return the attributes with the
specified prefix appended to the attribute name- it doesn’t make sense if
ReturnAttributes is also set.
3) Optional: Attribute list - list of attributes to return or return
all if not listed
4) Optional: ReturnAttributes change the name of the attributes on
return to those specified.
<resolver:DataConnector xsi:type="dc:Subject"
xmlns="urn:mace:shibboleth:2.0:resolver:dc"
id="subject_extract"
principalClass="customPrincipalClass"
resultPrefix=""
attributes = "uid cn sn">
<ReturnAttributes>ATTRIBUTE_1 ATTRIBUTE_2
ATTRIBUTE_3</ReturnAttributes>
</resolver:DataConnector>
The other issue less problematic issue in extracting a large number of
dynamic attributes is having to give explicit AttributeDefinitions and
AttributeEncoders to each of them even if I could easily have derived the
values from the attribute name. So it would be nice if I could
programmatically create AttributeDefinitions for an attribute in
javascript, and/or some how apply a AttributeDefinition to multiple
attributes at the same time somewhere in the attribute_resolver configfile.
<resolver:AttributeDefinition id="persistentId" xsi:type="Simple"
xmlns="urn:mace:shibboleth:2.0:resolver:ad"
id="custom1 custom2 custom3">
<resolver:AttributeEncoder xsi:type="enc:SAML1String"
name="urn:mace:dir:attribute-def:$INPUT" />
<resolver:AttributeEncoder xsi:type="enc:SAML2String" name="
https://mycustomnamespace/attributes/$INPUT" friendlyName="$INPUT" />
</resolver:AttributeDefinition>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20160211/d5bddba2/attachment.html>
More information about the users
mailing list