Announcement Announcement Module
No announcement yet.
Choosign between Authentication Providers at runtime Page Title Module
Move Remove Collapse
This topic is closed
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Choosign between Authentication Providers at runtime

    Hi all,

    I'm using Spring Security 2.0.5.RELEASE and was wonder if it was possible to have two authentication providers set-up and then have a runtime flag determining which one to use.

    e.g. Swapping between LDAP authentication and basic DB authentication.

    So for example I'd like to have the following configured:

    <!-- No remember me functionality, so auto-config is set to false -->
    <http access-denied-page="/accessDenied.jsp" auto-config='false'>
        <!-- The DB authentication provider, using SHA1 passwords -->
        <authentication-provider user-service-ref="userDetailsService">
            <password-encoder ref="sha1PasswordEncoder" />
        <!-- The custom LDAP Authentication provider -->
        <beans:bean id="ldapAuthenticationProvider" class="">
            <beans:constructor-arg ref="userDetailsService" />
            <beans:property name="authenticator" ref="ldapAuthenticator" />
            <custom-authentication-provider />
        <!-- More LDAP related beans follow -->
    And have the DB authentication provider as a default, but be able to swap to the LDAP provider at runtime.

    Has anyone tried this before?