<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">If you only want the one value, then why map the other values/have a DefaultValue? You want the other values "not mapped", so don't map them; having a DefaultValue does constitute a "mapping". Simply have nothing for the other values.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 8, 2018, at 3:25 PM, Baron Fujimoto <<a href="mailto:baron@hawaii.edu" class="">baron@hawaii.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class="">On Thu, Jun 07, 2018 at 03:14:42AM +0000, Lipscomb, Gary wrote:<br class=""><blockquote type="cite" class=""><br class=""><AttributeDefinition xsi:type="Mapped"<br class=""> id=" hasFoo"<br class=""> sourceAttributeID=" someAttr "><br class=""> <Dependency ref=" someAttr " /><br class=""> <DisplayName xml:lang="en">Has Foo</DisplayName><br class=""><br class=""> <ValueMap><br class=""> <ReturnValue>true</ReturnValue><br class=""> <SourceValue>foo</SourceValue><br class=""> </ValueMap><br class=""> <ValueMap><br class=""><br class=""> <ReturnValue>false</ReturnValue><br class=""> <SourceValue>bar</SourceValue><br class=""> <SourceValue>baz</SourceValue><br class=""> </ValueMap><br class=""><br class=""> </AttributeDefinition><br class=""></blockquote><br class="">Hi Gary,<br class=""><br class="">Thanks, but I think this is more or less equivalent to my original attempt below? Except I use a <DefaultValue> for the false terms rather than explicitly matching each value with a <ValueMap>. It's not really feasible for us to explicitly match each false value anyway, since the set of these values is not fixed in size and they may have arbitrary values (email addresses would be a good analogy).<br class=""><br class="">This still has the problem I'm trying to solve of resulting in a multivalued "hasFoo" after deduping:<br class=""><br class="">Log excerpt:<br class=""><br class="">DEBUG [net.shibboleth.idp.attribute.resolver.impl.AttributeResolverImpl:434] - Attribute Resolver 'ShibbolethAttributeResolver': De-duping attribute definition hasFoo result<br class="">DEBUG [net.shibboleth.idp.attribute.resolver.impl.AttributeResolverImpl:440] - Attribute Resolver 'ShibbolethAttributeResolver': Removing duplicate value StringAttributeValue{value=false} of attribute 'hasFoo' from resolution result<br class="">DEBUG [net.shibboleth.idp.attribute.resolver.impl.AttributeResolverImpl:440] - Attribute Resolver 'ShibbolethAttributeResolver': Removing duplicate value StringAttributeValue{value=false} of attribute 'hasFoo' from resolution result<br class="">DEBUG [net.shibboleth.idp.attribute.resolver.impl.AttributeResolverImpl:446] - Attribute Resolver 'ShibbolethAttributeResolver': Attribute 'hasFoo' has 2 values after post-processing<br class=""><br class="">Excerpt from output of resolvertest:<br class=""><br class=""> {<br class=""> "name": "hasFoo",<br class=""> "values": [<br class=""> "StringAttributeValue{value=false}", "StringAttributeValue{value=true}" ]<br class=""> }<br class=""><br class="">But what I'd really like as a result is:<br class=""><br class=""> {<br class=""> "name": "hasFoo",<br class=""> "values": [<br class=""> "StringAttributeValue{value=true}" ]<br class=""> }<br class=""><br class=""><br class=""><blockquote type="cite" class="">-----Original Message-----<br class="">From: users [<a href="mailto:users-bounces@shibboleth.net" class="">mailto:users-bounces@shibboleth.net</a>] On Behalf Of Baron Fujimoto<br class="">Sent: Thursday, 7 June 2018 12:56<br class="">To: Shib Users <<a href="mailto:users@shibboleth.net" class="">users@shibboleth.net</a>><br class="">Subject: AttributeDefinition multivalued to single value attribute?<br class=""><br class="">Is there a recommended way to create an AttributeDefinition in the IdP's<br class="">attribute-resolver.xml that will map a multivalued source attribute to a<br class="">new single valued attribute?<br class=""><br class="">For example, if I have the a multivalued source attribute, "someAttr" with<br class="">values as follows:<br class=""><br class="">someAttr: foo<br class="">someAttr: bar<br class="">someAttr: baz<br class=""><br class="">And I would like to define a new attribute, "hasFoo" which has value either<br class="">"true" or "false" depending on the value of someAttr.<br class=""><br class="">If I do something like this<br class=""><br class=""><resolver:AttributeDefinition xsi:type="ad:Mapped"<br class=""> id="hasFoo-enabled"<br class=""> sourceAttributeID="someAttr"><br class=""><br class=""> [...]<br class=""><br class=""> <!-- if someAttr is not "foo" return false --><br class=""> <ad:DefaultValue>false</ad:DefaultValue><br class=""><br class=""> <!-- map "foo" to "true" --><br class=""> <ad:ValueMap><br class=""> <ad:ReturnValue>true</ad:ReturnValue><br class=""> <ad:SourceValue ignoreCase="true">foo</ad:SourceValue><br class=""> </ad:ValueMap><br class=""></resolver:AttributeDefinition><br class=""><br class="">I wind up with a multivalued set of hasFoo like<br class=""><br class="">hasFoo: true<br class="">hasFoo: false<br class="">hasFoo: false<br class=""><br class="">But the result I really want is just a single hasFoo with value "true" if<br class="">there was a someAttr with value "foo", else hasFoo should be "false".<br class=""><br class="">The broader context for this is that I would like to return the single<br class="">valued "hasFoo" in an AttributeFilterPolicy, and conditionally release<br class="">other attributes based on the value of hasFoo. Maybe there's a better<br class="">way to tackle this broader goal?<br class=""><br class="">-- <br class="">Baron Fujimoto <<a href="mailto:baron@hawaii.edu" class="">baron@hawaii.edu</a>> :: UH Information Technology Services<br class="">minutas cantorum, minutas balorum, minutas carboratum desendus pantorum<br class="">-- <br class="">For Consortium Member technical support, see <a href="https://wiki.shibboleth.net/confluence/x/coFAAg" class="">https://wiki.shibboleth.net/confluence/x/coFAAg</a><br class="">To unsubscribe from this list send an email to <a href="mailto:users-unsubscribe@shibboleth.net" class="">users-unsubscribe@shibboleth.net</a><br class="">-- <br class="">For Consortium Member technical support, see <a href="https://wiki.shibboleth.net/confluence/x/coFAAg" class="">https://wiki.shibboleth.net/confluence/x/coFAAg</a><br class="">To unsubscribe from this list send an email to <a href="mailto:users-unsubscribe@shibboleth.net" class="">users-unsubscribe@shibboleth.net</a><br class=""></blockquote><br class="">-- <br class="">Baron Fujimoto <<a href="mailto:baron@hawaii.edu" class="">baron@hawaii.edu</a>> :: UH Information Technology Services<br class="">minutas cantorum, minutas balorum, minutas carboratum desendus pantorum<br class="">-- <br class="">For Consortium Member technical support, see <a href="https://wiki.shibboleth.net/confluence/x/coFAAg" class="">https://wiki.shibboleth.net/confluence/x/coFAAg</a><br class="">To unsubscribe from this list send an email to <a href="mailto:users-unsubscribe@shibboleth.net" class="">users-unsubscribe@shibboleth.net</a><br class=""><br class="">----------<br class=""><br class="">This email has been scanned for spam and viruses by Proofpoint Essentials. Visit the following link to report this email as spam:<br class=""><a href="https://us2.proofpointessentials.com/index01.php?mod_id=11&mod_option=logitem&mail_id=1528489549-Mt59gIRTN77a&r_address=mgrady%40unicon.net&report=1" class="">https://us2.proofpointessentials.com/index01.php?mod_id=11&mod_option=logitem&mail_id=1528489549-Mt59gIRTN77a&r_address=mgrady%40unicon.net&report=1</a><br class=""></div></div></blockquote></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">--<br class="">Michael A. Grady<br class="">IAM Architect, Unicon, Inc.</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><br class="Apple-interchange-newline">
</div>
<br class=""></div></body></html>