I'm using an AcegiAuthenticationSource decorated in a DefaultValuesAuthenticationSourceDecorator since when I'm creating a new user there won't be a valid user in the SecurityContext. The problem is that the AcegiAuthenticationSource blows up and the DefaultValuesAuthenticationSourceDecorator doesn't supply it's default values.
Here are my bean definitions:
And here is what it's producing:Code:<bean id="acegiAuthenticationSource" class="org.springframework.ldap.support.authentication.AcegiAuthenticationSource"/> <bean id="authenticationSource" class="org.springframework.ldap.support.authentication.DefaultValuesAuthenticationSourceDecorator"> <property name="target" ref="acegiAuthenticationSource"/> <property name="defaultUser" value="${ldap:bind.dn}"/> <property name="defaultPassword" value="${ldap:bind.pw}"/> </bean> <bean id="contextSource" class="org.springframework.ldap.support.LdapContextSource"> <property name="url" value="${ldap:server.url}"/> <property name="base" value="${ldap:base.dn}"/> <property name="authenticationSource" ref="authenticationSource"/> </bean> <bean id="ldapTemplate" class="org.springframework.ldap.LdapTemplate"> <constructor-arg ref="contextSource"/> </bean>
I'm not sure what good the DefaultValuesAuthenticationSourceDecorator is if it doesn't supply it's values when there aren't already valid ones? Am I missing something?Code:java.lang.IllegalArgumentException: The principal property of the authentication object -needs to be a LdapUserDetails. at org.springframework.ldap.support.authentication.AcegiAuthenticationSource.getPrincipal(AcegiAuthenticationSource.java:51) at org.springframework.ldap.support.authentication.DefaultValuesAuthenticationSourceDecorator.getPrincipal(DefaultValuesAuthenticationSourceDecorator.java:96)
(*Chris*)


Reply With Quote