code: public void afterPropertiesSet() {
  		// Ensure that we have our authentication manager
  		if (getAuthenticationManager() == null) {
  			if (logger.isDebugEnabled()) {
  				logger.debug("No AuthenticationManager defined, look for one");
  			}
  
  			// Try the class types in sequence
  			Class[] types = new Class[] { ProviderManager.class,
  					AuthenticationProvider.class, AuthenticationManager.class };
  
  			for (int i = 0; i < types.length; i++) {
  				if (tryToWire(types[i])) {
  					break;
  				}
  			}
  		}
  	}
docs: Ensure that we have an authentication manager to work with. If one has
  not been specifically wired in, then look for beans to "auto-wire" in.
  Look for a bean of one of the following types (in order):
  {@link ProviderManager}, {@link AuthenticationProvider}, and
  {@link AuthenticationManager}.
  
  @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()