How to set warningPeriod for EDirectoryAuthenticationResponseHandler

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to set warningPeriod for EDirectoryAuthenticationResponseHandler

cbaker
I'm trying to use the following bean in ldap-authn-config.xml

    <bean id="eDirAuthenticationResponseHandler" class="org.ldaptive.auth.ext.EDirectoryAuthenticationResponseHandler">
       
        <constructor-arg index="0" value="P1W" />
    </bean>

I've tried it with a value if "120" as well, and they both throw an error resembling the following

nested exception is java.lang.IllegalArgumentException: P1W

In the ldaptive docs it says it takes a Period class, do I make one of those as a separate bean and reference it in the constructor-arg?

I've tried to do something like

<bean id="oneWeekPeriod" class="java.time.Period">
  <property name="parse" value="P1W"/>
</bean> 
<bean id="eDirAuthenticationResponseHandler" class="org.ldaptive.auth.ext.EDirectoryAuthenticationResponseHandler">
   
    <constructor-arg index="0" ref="oneWeekPeriod" />
</bean>

It throws the following
Unsatisfied dependency expressed through constructor parameter 0: No qualifying bean of type [int] found for dependency [int]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [int] found for dependency [int]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}'


So it seems like it's trying to autowire and int out of whatever I try to give it, not a Period?

Thanks,
-Craig B
Reply | Threaded
Open this post in threaded view
|

Re: How to set warningPeriod for EDirectoryAuthenticationResponseHandler

cbaker
  <bean id="eDirAuthenticationResponseHandler" class="org.ldaptive.auth.ext.EDirectoryAuthenticationResponseHandler">
       
        <constructor-arg index="0" value="120" type="int" />
    </bean>

I was missing type="int"  It works now...