...
This attribute definition allows Java code to be written in the definition and executed when the attribute is requested. This provides nearly limitless flexability for creating or tansforming attributes.%INCLUDE{"AttributeDefinitionBasics"}%
Include Page | ||||
---|---|---|---|---|
|
Configuring the Definition
- Create a ScriptletAttributeDefinition element with its id attribute.
- Create a Scriptlet element, child of ScriptletAttributeDefinition, whose content is Java code that should be executed when this attribute is requested. You may wish to place this data in a CDATA section to ensure it does not interfere with the XML processing.
...
Field Name | Field Type | Description |
resolverAttribute | edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute | The incoming attribute |
principal | java.security.Principal | The principal of the user whose attributes are being fetched |
requester | String | The ID of the service provider to whom the attributes are going |
responder | String | The ID of the identity provider |
dependencies | edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies | The connectors and attributes this definition depends on |
log | org.apache.log4j.Logger | The logger for this definition |
...
Code Block |
---|
<ScriptletAttributeDefinition id="urn:mace:dir:attribute-def:eduPersonAffiliation"> <DataConnectorDependency requires="directory"/> <Scriptlet> <![CDATA[ Attributes attributes = dependencies.getConnectorResolution("directory"); Attribute affiliation = attributes.get("eduPersonAffiliation"); if (affiliation.size() > 0) { resolverAttribute.addValue("affiliate"); } ]]> </Scriptlet> </ScriptletAttributeDefinition> |
%INCLUDE{"AttributeDefinitionDependencies"}%
...
Include Page | ||||
---|---|---|---|---|
|
Include Page | ||||
---|---|---|---|---|
|