AttributeDefinition multivalued to single value attribute?
Lipscomb, Gary
glipscomb at csu.edu.au
Wed Jun 6 23:14:42 EDT 2018
<AttributeDefinition xsi:type="Mapped"
id=" hasFoo"
sourceAttributeID=" someAttr ">
<Dependency ref=" someAttr " />
<DisplayName xml:lang="en">Has Foo</DisplayName>
<ValueMap>
<ReturnValue>true</ReturnValue>
<SourceValue>foo</SourceValue>
</ValueMap>
<ValueMap>
<ReturnValue>false</ReturnValue>
<SourceValue>bar</SourceValue>
<SourceValue>baz</SourceValue>
</ValueMap>
</AttributeDefinition>
-----Original Message-----
From: users [mailto:users-bounces at shibboleth.net] On Behalf Of Baron Fujimoto
Sent: Thursday, 7 June 2018 12:56
To: Shib Users <users at shibboleth.net>
Subject: AttributeDefinition multivalued to single value attribute?
Is there a recommended way to create an AttributeDefinition in the IdP's
attribute-resolver.xml that will map a multivalued source attribute to a
new single valued attribute?
For example, if I have the a multivalued source attribute, "someAttr" with
values as follows:
someAttr: foo
someAttr: bar
someAttr: baz
And I would like to define a new attribute, "hasFoo" which has value either
"true" or "false" depending on the value of someAttr.
If I do something like this
<resolver:AttributeDefinition xsi:type="ad:Mapped"
id="hasFoo-enabled"
sourceAttributeID="someAttr">
[...]
<!-- if someAttr is not "foo" return false -->
<ad:DefaultValue>false</ad:DefaultValue>
<!-- map "foo" to "true" -->
<ad:ValueMap>
<ad:ReturnValue>true</ad:ReturnValue>
<ad:SourceValue ignoreCase="true">foo</ad:SourceValue>
</ad:ValueMap>
</resolver:AttributeDefinition>
I wind up with a multivalued set of hasFoo like
hasFoo: true
hasFoo: false
hasFoo: false
But the result I really want is just a single hasFoo with value "true" if
there was a someAttr with value "foo", else hasFoo should be "false".
The broader context for this is that I would like to return the single
valued "hasFoo" in an AttributeFilterPolicy, and conditionally release
other attributes based on the value of hasFoo. Maybe there's a better
way to tackle this broader goal?
--
Baron Fujimoto <baron at hawaii.edu> :: UH Information Technology Services
minutas cantorum, minutas balorum, minutas carboratum desendus pantorum
--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net
More information about the users
mailing list