Spring security and authentication provider

Posted by Pascal on Stack Overflow See other posts from Stack Overflow or by Pascal
Published on 2010-05-31T09:35:27Z Indexed on 2010/05/31 9:43 UTC
Read the original article Hit count: 340

Filed under:
|
|

I'm trying to implement Spring 3 Security in a project, but I can not get rid of the following error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_authenticationManager': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No authentication providers were found in the application context

This seems weird, as I did provide an authentication provider!

I've added these lines to web.

<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

And this is my applicationContext-security.xml:

<http auto-config="false">
    <intercept-url pattern="/**" access="ROLE_USER" />        
    <http-basic />
</http>

<authentication-manager alias="authenticationManager">
    <authentication-provider>
        <user-service>
            <user name="jimi" password="jimispassword" authorities="ROLE_USER, ROLE_ADMIN"/>
            <user name="bob" password="bobspassword" authorities="ROLE_USER"/>
        </user-service>
    </authentication-provider>
</authentication-manager>

Google couldn't help me much further, nor could the official documentation.

© Stack Overflow or respective owner

Related posts about java

Related posts about spring