<div dir="ltr">I'm trying to populate an attribute, eduPersonPrimaryAffiliation, from another attribute that I have available in our LDAP structure, bucknellEduPersonPrimaryAffiliation.  Normally, I'd just release bucknellEduPersonPrimaryAffiliation and be done with it.  Unfortunately, the SP requires a valid value in the attribute and there are a number of entries in our LDAP structure for this attribute that have no value (or a "not real valid" value).  Based on this I tried writing the following resolver script:<div><br></div><div><div>    <resolver:AttributeDefinition id="eduPersonPrimaryAffiliation" </div><div>                                  xsi:type="ad:Script"></div><div>        <resolver:Dependency ref="myLDAP" /></div><div>        <resolver:AttributeEncoder xsi:type="enc:SAML1String" name="urn:mace:dir:attribute-def:eduPersonPrimaryAffiliation" /></div><div>        <resolver:AttributeEncoder xsi:type="enc:SAML2String" name="urn:oid:1.3.6.1.4.1.5923.1.1.1.5" friendlyName="eduPersonPrimaryAffiliation" /></div><div><br></div><div>   <ad:Script><![CDATA[</div><div>        // If the user has group membership</div><div>        if (typeof eduPersonAffiliation != "undefined" ){</div><div>            value = bucknellEduPersonPrimaryAffiliation.getValues();</div><div><br></div><div>            if (value.contains("faculty")){</div><div>                strPrimary = "faculty";</div><div>            } else if (value.contains("staff")){</div><div>                strPrimary = "staff";</div><div>            } else if (value.contains("student")){</div><div>                strPrimary = "student";</div><div>            } else if (value.contains("alum")){</div><div>                strPrimary = "alum";</div><div>            } else {</div><div>                strPrimary = "member";</div><div>            }</div><div>        }</div><div>        eduPersonPrimaryAffiliation.add(strPrimary);</div><div>        ]]></ad:Script></div><div><br></div><div>    </resolver:AttributeDefinition></div></div><div><br></div><div><br></div><div>The IdP starts fine, but when I try and release the attribute eduPersonPrimaryAffiliation, the script tries adding a number of attributes (uid, telephoneNumber, mail, etc) to eduPersonPrimaryAffiliation (as a "dependent attribute", which they are clearly not) as well as the attribute retrieved from bucknellEduPersonPrimaryAffiliation and ultimately errors out with the error:</div><div><br></div><div><div>14:57:45.050 - ERROR [net.shibboleth.idp.profile.impl.ResolveAttributes:257] - [134.82.79.6] - Profile Action ResolveAttributes: Error resolving attributes</div><div>net.shibboleth.idp.attribute.resolver.ResolutionException: Attribute Definition 'eduPersonPrimaryAffiliation': unable to execute script</div></div><div><br></div><div>Any suggestions will be greatly appreciated.</div><div><br></div><div>Thanks,</div><div>Mike</div></div>