Results 1 to 3 of 3

Thread: Chaining Authentication Providers

  1. #1
    Join Date
    Aug 2004
    Location
    Denver
    Posts
    249

    Default Chaining Authentication Providers

    From reading the documentation, it seems like it should be possible to chain authentication providers like the following:

    Code:
        <bean id="authenticationManager" class="net.sf.acegisecurity.providers.ProviderManager">
            <property name="providers">
                <list>
                    <ref local="daoAuthenticationProvider"/>
                    <ref local="jaasAuthenticationProvider"/>
                </list>
            </property>
        </bean>
    However, the only way to authenticate a user against the "jaasAuthenticationProvider" is to comment out the "daoAuthenticationProvider". Any ideas why?

    Thanks,

    Matt

  2. #2
    Join Date
    Nov 2004
    Location
    Dallas, TX (USA)
    Posts
    58

    Default

    Not sure if this is your issue but what I did is to extend the first provider in the list and rather than throw an exception if it failed to authenticate, it simply returns null which will cause the provider manager to keep trying. See topic http://forum.springframework.org/vie...099&highlight=

    HTH

  3. #3
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Each AuthenticationProvider is designed to process a particular class of Authentication. To faciltiate the fact most AuthenticationProvider use UsernamePasswordAuthenticationToken, the "return null" option was added as mentioned earlier.

    I've added to my TODO list a solution. I think modifying DaoAuthenticationProvider to return null if a property is set is the simplest solution. A more elegant solution would be to have the failover logic of each provider declaratively configured in ProviderManager. If anyone beats me to this, please feel free to submit a patch to this forum or the acegisecurity-developer list.

Similar Threads

  1. Curious about chaining authentication providers
    By crazeinc in forum Security
    Replies: 12
    Last Post: Apr 16th, 2007, 09:34 AM
  2. Replies: 2
    Last Post: Oct 13th, 2005, 02:47 PM
  3. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  4. Chaining Authentication Providers?
    By dhainlin in forum Security
    Replies: 1
    Last Post: Jan 22nd, 2005, 03:34 PM
  5. Replies: 8
    Last Post: Dec 7th, 2004, 06:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •