Announcement Announcement Module
No announcement yet.
weird problem with multiple authentication-providers with my spring-security app Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • weird problem with multiple authentication-providers with my spring-security app

    I recently incorporated ICEfaces3 based Spring Security LDAP authentication for my application. However I have been noticing the following weird behavior. Maybe somebody on here can either explain/correct me on it.

    Obviously, when I first implemented the solution, in my applicationContext-security.xml file, i implemented the simple <user-service> simple/dummy authentication. And after which I implemented my own CustomAuthentication provider. So, when I have both my simple(aka dummy) and my custom auth listed one after another like below, everything works fine.

    relevant snippet from my applicationContext-security.xml

    <authentication-manager alias="authenticationManager">
        	<!-- my dummy auth -->
                    <user name="test" password="pass" authorities=""/>
            <!-- my custom auth provider -->
            <authentication-provider ref="customAuthProvider"/>

    However, as I finish up with my testing, I obviously want to take out the dummy auth and only leave my custom auth as the only default auth provider. And everytime i do I see a ProviderNotFoundException. Both in my unit tests and within the tomcat container

    Is there any explanation for this, I tried quite a few variants where i used two instances of my same custom auth provider. Nothing seems to make the difference, the only time it works as designed if I have my dummy auth provider along with my custom provider. erNotFoundException: No AuthenticationProvider found for mePasswordAuthenticationToken
    at erManager.doAuthentication( 0)
    at ctAuthenticationManager.authenticate(AbstractAuthe
    at yTests.testAuthToken(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De
    at java.lang.reflect.Method.invoke(
    at org.junit.runners.model.FrameworkMethod$1.runRefle ctiveCall(
    Any insights appreciated!