IdPv3 - regex activation condition

Francesco Malvezzi francesco.malvezzi at unimore.it
Thu Jul 9 08:33:56 EDT 2015


[...]
>  You can find the class in system/conf/utilities.xml
> 
>> where can I find a reference for the shibboleth.Conditions.*
>> beans?
> 
> I only documented things that I explicitly used in files in the
> sections where I used them. I don't want to duplicate everything by
> creating a master reference right now, but eventually I'll do a page
> on conditions. That's a long way off.
> 
> The bean you're inheriting from is the
> net.shibboleth.idp.profile.logic.RelyingPartyIdPredicate class, which
> if you look at the javadoc has a c'tor variant that takes a
> Predicate<String>. We don't have anything that implements that based
> on a regex, you would have to provide that code and plug that in to
> the constructor. The "hard" part of actually linking that back to the
> thing you're evaluating (the relying party name) is done for you.

Thank you for the hint.

Th activation condition looks like, now:

   <bean id="exampleOrgRegex" class="java.util.regex.Pattern"
factory-method="compile" c:_0="^http[s]?://[^/]*\.example\.org.*" />

<!--
(thank you, Douglas, for fixing the regex)
-->

    <bean id="exampleOrgRegexPredicate"
class="com.google.common.base.Predicates" factory-method="contains"
c:_0-ref="exampleOrgRegex" />

    <bean id="shibboleth.noConsentRelyingPartyPredicate"
class="net.shibboleth.idp.profile.logic.RelyingPartyIdPredicate"
c:pred-ref="exampleOrgRegexPredicate" />

and it is referenced in relying-party.xml with:

            <bean id="shibboleth.noConsentRelyingParty"
parent="RelyingParty">
                <property name="activationCondition"
                          ref="shibboleth.noConsentRelyingPartyPredicate" />
                <property name="profileConfigurations">
			<list>
        		<!-- Your refs or beans here. -->
        		</list>
    		</property>	
	    </bean>

it even works!

ciao,

Francesco


-- 
Servizio gestione identità
Via Campi, 213/b
41125 Modena


More information about the users mailing list