extending/modifying expiring password flow and LDAP properties

Scott Koranda skoranda at gmail.com
Thu May 18 11:31:58 EDT 2017


Hello,

I am using IdP 3.3.1.

I am extending/modifying the expiring-password-flox.xml. I created my
own <action-state> that contains my own <evaluate expression="MyBean">
and added

<bean-import resource="expiring-password-beans.xml">

I then defined in expiring-password-beans.xml

<bean id="MyBean"
 class="org.my.myclass"
 p:httpServletRequst-ref="shibboleth.HttpServletRequest" />

This worked well and in my skeleton class I was able to "see"
the javax.servlet.http.HttpServletRequest. All good.

Next I wanted to inject into my bean an instance of
org.ldaptive.auth.Authenticator, primarily so I could then get a
"handle" on an LDAP connection and do what I need to do on the
authenticated user's LDAP record.

So I set in expiring-password-beans.xml

   <import resource="../../../../conf/authn/ldap-authn-config.xml" />

and modified my bean to be

<bean id="MyBean"
 class="org.my.myclass"
 p:httpServletRequst-ref="shibboleth.HttpServletRequest" 
 p:authenticator-ref="bindSearchAuthenticator" />

(since I am in fact using bind search).

The problem is that when Spring instantiantes my bean it complains that
it cannot resolve the properties in ldap-authn-config.xml like

"%{idp.pool.LDAP.blockWaitTime:3000}"

Specifically I see

Caused by: org.springframework.beans.TypeMismatchException: Failed to convert pr
operty value of type [java.lang.String] to required type [long] for property 'bl
ockWaitTime'; nested exception is java.lang.NumberFormatException: For input str
ing: "%{idp.pool.LDAP.blockWaitTime:3000}"
        at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfN
ecessary(AbstractNestablePropertyAccessor.java:596)
Caused by: java.lang.NumberFormatException: For input string: "%{idp.pool.LDAP.b
lockWaitTime:3000}"

If I edit ldap-authn-config.xml and specifically configure

p:blockWaitTime="3000"

then it fails on the next Spring expression trying to substitute a property, 
ie.

p:failFastInitialize="%{idp.pool.LDAP.failFastInitialize:false}" />

Why can Spring resolve those properties when the authenticator is injected
into ValidateUsernamePasswordAgainstLDAP but not my bean?

What I really want to do is just modify the DN in my flow. Is there a better
way that I should be getting a connection to LDAP in my class other than
injecting an authenticator and then going "upstream" to get the connection pool
and get a connection?

Thanks,

Scott K



More information about the dev mailing list