Activation Condition Predicate for an Empty Attribute
Martin Lunze
martin.lunze at tu-dresden.de
Fri Aug 11 01:15:52 EDT 2017
Hi Michael,
maybe it's a possible alternative to solve this problem with a scripted
attribute-definition like that?
> <Script>
> <![CDATA[
> if (typeof your-other-attr !== "undefined" &&
> your-other-attr.getValues().size() > 0) {
> mail.addValue(your-other-attr.getValues().get(0));
> } else {
> mail.addValue("some-special-value");
> }
> ]]>
> </Script>
With nice regards
Martin
On 10.08.2017 18:01, Domingues, Michael D wrote:
>
> Hi All,
>
>
> I'm currently attempting to write an Activation Condition predicate to
> test if an attribute is empty. The approach that I've taken, modeled
> off the documentation [1] is to wrap a wildcard
> SimpleAttributePredicate in a NOT condition like so:
>
>
> <!-- Ensure that mail is not already populated -->
> <bean parent="shibboleth.Conditions.NOT">
> <constructor-arg>
> <bean
> class="net.shibboleth.idp.profile.logic.SimpleAttributePredicate">
> <property name="attributeValueMap">
> <map>
> <entry key="mail">
> <list>
> <value>*</value>
> </list>
> </entry>
> </map>
> </property>
> </bean>
> </constructor-arg>
> </bean>
>
> Unfortunately, in so doing, I discovered that SimpleAttributePredicate
> wildcarding returns true, even for empty attributes (that get pulled
> out of the connected data source as EmptyAttributeValue objects). This
> seems like a bug to me, and I've filed a report here [2].
>
>
> As a stop-gap, does anybody have a good approach (outside of writing a
> custom predicate bean myself) to return true only if an attribute is
> empty or non-existent?
>
>
> Many thanks in advance,
>
> Michael
>
> [1]
> https://wiki.shibboleth.net/confluence/display/IDP30/ActivationConditions
>
> [2] https://issues.shibboleth.net/jira/browse/IDP-1206
>
>
>
>
--
Martin Lunze
IT-Systemadministrator
Technische Universität Dresden
Zentrum für Informationsdienste und Hochleistungsrechnen (ZIH)
Prozessmanagement und Controlling (PMC)
01062 Dresden
Tel.: +49 (351) 463-35881
E-Mail: martin.lunze at tu-dresden.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20170811/0d6ba1ad/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5677 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://shibboleth.net/pipermail/users/attachments/20170811/0d6ba1ad/attachment.p7s>
More information about the users
mailing list