attribute resolver script

Andrew Morgan morgan at orst.edu
Wed Nov 23 15:09:36 EST 2016


On Wed, 23 Nov 2016, Cantor, Scott wrote:

> On 11/23/16, 1:10 PM, "users on behalf of Andrew Morgan" <users-bounces at shibboleth.net on behalf of morgan at orst.edu> wrote:
>
>> Is there another way to apply a default value for an attribute that
>>    doesn't involve a Scripted attribute definition?  I've been avoiding
>>    Scripted attributes so far given the ugliness of the Java engine stuff.
>
> Template. That's just scripting with Velocity.

I'm not familiar with Velocity.  I've seen it used on the IDP's views, but 
I've never written Velocity.  Is this a reasonable way to assign a default 
value:

<AttributeDefinition xsi:type="Template" id="webex_firstname">
     <Dependency ref="ONIDLDAP" />
     <AttributeEncoder xsi:type="SAML2String" name="firstname" />

     <ad:Template>
       #if( !$givenName or $givenName.isEmpty() )
         #set( $fn = "." )
       #else
         #set( $fn = $givenName )
       #end
       ${fn}
     </ad:Template>
     <ad:SourceAttribute>givenName</ad:SourceAttribute>
</AttributeDefinition>


Thanks,
 	Andy


More information about the users mailing list