Hello Luke, thank you for this new release. I wanted to give it a try this morning by upgrading my project from Spring M3 to M4 and Spring Security M1 to M2. When changing my namespace configuration to match M2 requirements I get the following error and I'm kinda lost.
This is what I used to have with M1 :
Code:
<security:authentication-provider>
<security:user-service>
<security:user name="user" password="user" authorities="ROLE_USER" />
<security:user name="supervisor" password="supervisor" authorities="ROLE_SUPERVISOR" />
<security:user name="admin" password="admin" authorities="ROLE_ADMIN" />
</security:user-service>
</security:authentication-provider>
And in one of my classes I would retrieve the DaoAuthenticationProvider through autowiring in order to run some tests
Code:
@Autowired
private DaoAuthenticationProvider authenticationProvider ;
Everything was working fine.
Now when switching to M2 I changed my xml config file according to your post and M2 sample apps :
Code:
<security:authentication-manager>
<security:authentication-provider>
<security:user-service>
<security:user name="user" password="user" authorities="ROLE_USER" />
<security:user name="supervisor" password="supervisor" authorities="ROLE_SUPERVISOR" />
<security:user name="admin" password="admin" authorities="ROLE_ADMIN" />
</security:user-service>
</security:authentication-provider>
</security:authentication-manager>
When I start my application the DaoAuthenticationProvider is no longer autowired :
Code:
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.security.authentication.dao.DaoAuthenticationProvider test.com.colleos.core.security.abstracts.AbstractSecurityTest.authenticationProvider; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.springframework.security.authentication.dao.DaoAuthenticationProvider] is defined: Unsatisfied dependency of type [class org.springframework.security.authentication.dao.DaoAuthenticationProvider]: expected at least 1 matching bean
I'm lost since looking at the updated documentation it reads that the <authentication-provider> element creates a DaoAuthenticationProvider bean
Thanks for your help.