<div dir="ltr"><div><div>Getting closer -- leveraging the Dependency as the givenName and lastName come from 2 distinct AttributeResolvers (each has their own AttributeDefinitions).<br><br></div>The following does not sent any values for displayName as an AttribureDefinition (although script attribute has the givenName+sn value) -- any thoughts on why?<br><br></div>Thanks.<br><div><div><div><br> <AttributeDefinition id="displayName" xsi:type="ScriptedAttribute"><br>            <Dependency ref="givenName" /><br>            <Dependency ref="sn" /><br>            <Script><br>             <![CDATA[<br>                    load("nashorn:mozilla_compat.js");<br>                     importPackage(Packages.edu.internet2.middleware.shibboleth.common.attribute.provider);<br>                    importPackage(Packages.org.slf4j);<br>                     logger = LoggerFactory.getLogger("edu.internet2.middleware.shibboleth.resolver.Script.scriptLog");<br>                     displayName = new BasicAttribute("displayName");<br>                     if (givenName != null || sn != null)<br>                     {<br>                         if (!givenName.getValues().isEmpty() || !sn.getValues().isEmpty())<br>                         {    <br>                             <a href="http://logger.info">logger.info</a>("givenName was not null or empty: " +givenName.getValues());<br>                             <a href="http://logger.info">logger.info</a>("sn was not null or empty: " +givenName.getValues());<br>                             displayName.getValues().add(givenName.getValues());<br>                             displayName.getValues().add(" ");<br>                             displayName.getValues().add(sn.getValues());<br>                             <a href="http://logger.info">logger.info</a>("displayName: " +displayName.getValues());<br>                         }<br>                     }           <br>                ]]><br>            </Script><br>            <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.16.840.1.113730.3.1.241" friendlyName="displayName"/>                                                   <br>       </AttributeDefinition> <br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 8, 2017 at 2:45 PM, Lipscomb, Gary <span dir="ltr"><<a href="mailto:glipscomb@csu.edu.au" target="_blank">glipscomb@csu.edu.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Joel,<br>
<br>
Try this (v2 IdP)<br>
<br>
    <resolver:AttributeDefinition xsi:type="Template" xmlns="urn:mace:shibboleth:2.<wbr>0:resolver:ad"<br>
            id="displayName"><br>
        <resolver:Dependency ref="myLDAP" /><br>
        <resolver:DisplayName xml:lang="en">Display Name</resolver:DisplayName><br>
        <resolver:AttributeEncoder xsi:type="SAML1String" xmlns="urn:mace:shibboleth:2.<wbr>0:attribute:encoder"<br>
            name="urn:mace:dir:attribute-<wbr>def:displayname" /><br>
        <resolver:AttributeEncoder xsi:type="SAML2String" xmlns="urn:mace:shibboleth:2.<wbr>0:attribute:encoder"<br>
            name="urn:oid:2.16.840.1.<wbr>113730.3.1.241" friendlyName="Display Name" /><br>
        <Template><br>
            <![CDATA[<br>
                ${givenName} ${sn}<br>
            ]]><br>
        </Template><br>
            <SourceAttribute>sn</<wbr>SourceAttribute><br>
            <SourceAttribute>givenName</<wbr>SourceAttribute><br>
        </resolver:<wbr>AttributeDefinition><br>
<br>
Gary<br>
<br>
From: users [mailto:<a href="mailto:users-bounces@shibboleth.net">users-bounces@<wbr>shibboleth.net</a>] On Behalf Of Joel Levin<br>
Sent: Thursday, 9 February 2017 9:23<br>
To: Shib Users <<a href="mailto:users@shibboleth.net">users@shibboleth.net</a>><br>
Subject: Re: AttributeDefinition: Merge results from 2 Data Connectors<br>
<div class="HOEnZb"><div class="h5"><br>
Thanks for the tip --- the below sends both 'givenName' & 'sn' -- but not in format of 'givenName sn' (with space between 'givenName' & 'sn').<br>
I am not too sure how to parse this via Script if 2 dependencies -- are there any examples or tips that can point me?<br>
<br>
<AttributeDefinition id="displayName" xsi:type="Simple"><br>
            <Dependency ref="givenName" /><br>
            <Dependency ref="sn" /><br>
            <AttributeEncoder xsi:type="SAML2String" name="urn:oid:2.16.840.1.<wbr>113730.3.1.241" friendlyName="displayName"/>  <wbr>                              <wbr>                  <br>
       </AttributeDefinition><br>
<br>
On Wed, Feb 8, 2017 at 1:21 PM, Cantor, Scott <<a href="mailto:cantor.2@osu.edu">cantor.2@osu.edu</a>> wrote:<br>
On 2/8/17, 4:15 PM, "users on behalf of Brent Putman" <<a href="mailto:users-bounces@shibboleth.net">users-bounces@shibboleth.net</a> on behalf of <a href="mailto:putmanb@georgetown.edu">putmanb@georgetown.edu</a>> wrote:<br>
<br>
> Ah.  The template wiki docs actually illustrate 2 deps:<br>
<br>
Oh, then it probably just works. I forgot Template lets you specify each source ID separately inside its own config, so that probably addresses it, it probably checks each dependency for a match.<br>
<br>
> but perhaps the first is intended to be an AttributeDefinition rather than DataConnector.  If 2 data connectors is a<br>
> problem, I guess one could always define 2 simple 'sn' and 'givenName' AttributeDefinitions to feed to the template one.<br>
<br>
Yes, if it can't automatically locate the right source data the way it should, that would work.<br>
<br>
-- Scott<br>
<br>
<br>
--<br>
To unsubscribe from this list send an email to <a href="mailto:users-unsubscribe@shibboleth.net">users-unsubscribe@shibboleth.<wbr>net</a><br>
<br>
--<br>
To unsubscribe from this list send an email to <a href="mailto:users-unsubscribe@shibboleth.net">users-unsubscribe@shibboleth.<wbr>net</a></div></div></blockquote></div><br></div>