<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">The following script from our IdP resolver for ePA does an analogous operation, sending a default/fallback value of ePA even if none exists in the LDAP:<div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(44, 182, 195); background-color: rgb(255, 250, 194);"><Script></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(44, 182, 195); background-color: rgb(255, 250, 194);"><span style="color: #2cb820"><![</span><span style="color: #c97520">CDATA</span><span style="color: #2cb820">[</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);"> importPackage(Packages.edu.internet2.middleware.shibboleth.common.attribute.provider);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);"> importPackage(Packages.org.slf4j);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);"> logger = LoggerFactory.getLogger("edu.internet2.middleware.shibboleth.resolver.Script.scriptTest");</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);">// Manipulate values only if <span style="color: #991200; background-color: #e6e600">eduPersonAffiliation</span> directory value(s) exist</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);">if (typeof <span style="color: #991200; background-color: #e6e600">eduPersonAffiliation</span> != "undefined" && <span style="color: #991200; background-color: #e6e600">eduPersonAffiliation</span> != null) </div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);">{ …some manipulation of values omitted here… }</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);">// Otherwise, create if null and add attribute value "Affiliate"</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);"> else</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(153, 18, 0); background-color: rgb(230, 230, 0);"><span style="color: #bf341d; background-color: #fffac2">if (</span>eduPersonAffiliation<span style="color: #bf341d; background-color: #fffac2"> == null) {</span>eduPersonAffiliation<span style="color: #bf341d; background-color: #fffac2"> = new BasicAttribute("</span>eduPersonAffiliation<span style="color: #bf341d; background-color: #fffac2">");}</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);"> {</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);">logger.debug(" ePA script if statement ELSE; ePA values: " + <span style="color: #991200; background-color: #e6e600">eduPersonAffiliation</span>.getValues()); </div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);"> <span style="color: #991200; background-color: #e6e600">eduPersonAffiliation</span>.getValues().add("Affiliate");</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);">logger.debug(" ePA script add Affiliate; ePA values: " + <span style="color: #991200; background-color: #e6e600">eduPersonAffiliation</span>.getValues());</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(191, 52, 29); background-color: rgb(255, 250, 194);"> }</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(44, 182, 195); background-color: rgb(255, 250, 194);"><span style="color: #bf341d"> </span><span style="color: #2cb820">]]></span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(44, 182, 195); background-color: rgb(255, 250, 194);"></Script></div><div><br></div><div><div>David Bantz</div><div>U Alaska</div><div><br></div><div>On Tue, 20 May 2014, at 17:04 , Jason <<a href="mailto:shibboleth@happycat.org.uk">shibboleth@happycat.org.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi All,<br><br>I'm working on setting up an integration between a Shibboleth IdP and<br>a third-party service provider.<br><br>The service provider wants a custom attribute called "Application".<br>I've defined that attribute, and the value of that attribute is<br>retrieved from an LDAP attribute also called "Application".<br><br>Getting the IdP to return whatever is in LDAP is working fine.<br>However, for users that don't have this attribute in LDAP, the IdP<br>doesn't return the attribute, which is totally understandable.<br><br>My question is this: for users that don't have the attribute in LDAP,<br>is it possible to have the IdP still return some value in the<br>attribute statement? If so, what's the best way to do that?<br><br>Thanks!<br>--<br>To unsubscribe from this list send an email to <a href="mailto:users-unsubscribe@shibboleth.net">users-unsubscribe@shibboleth.net</a><br></blockquote></div><br></div></div></body></html>