Uploaded image for project: 'Spring Security'
  1. Spring Security
  2. SEC-2933

Wrong XML configuration snippet of ProviderManager in reference guide

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.0.0
    • Fix Version/s: 4.0.1
    • Component/s: Docs and Website
    • Labels:
      None

      Description

      See http://docs.spring.io/spring-security/site/docs/4.0.x/reference/htmlsingle/#core-services-authentication-manager

      There is XML code snippet using non-parametric constructor that has been deprecated in Spring Security 3.x and was removed in Spring Security 4.x:

      <bean id="authenticationManager"
      	 class="org.springframework.security.authentication.ProviderManager">
      <property name="providers">
      	<list>
      	  <ref local="daoAuthenticationProvider"/>
      	  <ref local="anonymousAuthenticationProvider"/>
      	  <ref local="ldapAuthenticationProvider"/>
      	</list>
      </property>
      </bean>
      

      It should be fixed by using constructor argument instead of setting property.

      <bean id="authenticationManager"
      	 class="org.springframework.security.authentication.ProviderManager">
      <constructor-arg name="providers">
      	<list>
      	  <ref local="daoAuthenticationProvider"/>
      	  <ref local="anonymousAuthenticationProvider"/>
      	  <ref local="ldapAuthenticationProvider"/>
      	</list>
      </constructor-arg>
      </bean>
      

        Attachments

          Activity

            People

            Assignee:
            rwinch Rob Winch
            Reporter:
            trepel Tomas Repel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: