Announcement Announcement Module
Collapse
No announcement yet.
Choosign between Authentication Providers at runtime Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • 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:

    Code:
    <!-- 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" />
        </authentication-provider>
    
        <!-- The custom LDAP Authentication provider -->
        <beans:bean id="ldapAuthenticationProvider" class="org.ikasan.console.security.service.authentication.LdapAuthenticationProvider">
            <beans:constructor-arg ref="userDetailsService" />
            <beans:property name="authenticator" ref="ldapAuthenticator" />
            <custom-authentication-provider />
        </beans:bean>
    
        <!-- 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?
Working...
X