Class AbstractLdapAuthenticationProvider

    • Field Detail

      • logger

        protected final org.apache.commons.logging.Log logger
      • messages

        protected org.springframework.context.support.MessageSourceAccessor messages
    • Constructor Detail

      • AbstractLdapAuthenticationProvider

        public AbstractLdapAuthenticationProvider()
    • Method Detail

      • loadUserAuthorities

        protected abstract java.util.Collection<? extends GrantedAuthority> loadUserAuthorities​(org.springframework.ldap.core.DirContextOperations userData,
                                                                                                java.lang.String username,
                                                                                                java.lang.String password)
      • createSuccessfulAuthentication

        protected Authentication createSuccessfulAuthentication​(UsernamePasswordAuthenticationToken authentication,
                                                                UserDetails user)
        Creates the final Authentication object which will be returned from the authenticate method.
        Parameters:
        authentication - the original authentication request token
        user - the UserDetails instance returned by the configured UserDetailsContextMapper.
        Returns:
        the Authentication object for the fully authenticated user.
      • supports

        public boolean supports​(java.lang.Class<?> authentication)
        Description copied from interface: AuthenticationProvider
        Returns true if this AuthenticationProvider supports the indicated Authentication object.

        Returning true does not guarantee an AuthenticationProvider will be able to authenticate the presented instance of the Authentication class. It simply indicates it can support closer evaluation of it. An AuthenticationProvider can still return null from the AuthenticationProvider.authenticate(Authentication) method to indicate another AuthenticationProvider should be tried.

        Selection of an AuthenticationProvider capable of performing authentication is conducted at runtime the ProviderManager.

        Specified by:
        supports in interface AuthenticationProvider
        Returns:
        true if the implementation can more closely evaluate the Authentication class presented
      • setUseAuthenticationRequestCredentials

        public void setUseAuthenticationRequestCredentials​(boolean useAuthenticationRequestCredentials)
        Determines whether the supplied password will be used as the credentials in the successful authentication token. If set to false, then the password will be obtained from the UserDetails object created by the configured UserDetailsContextMapper. Often it will not be possible to read the password from the directory, so defaults to true.
        Parameters:
        useAuthenticationRequestCredentials -
      • setMessageSource

        public void setMessageSource​(org.springframework.context.MessageSource messageSource)
        Specified by:
        setMessageSource in interface org.springframework.context.MessageSourceAware
      • getUserDetailsContextMapper

        protected UserDetailsContextMapper getUserDetailsContextMapper()
        Provides access to the injected UserDetailsContextMapper strategy for use by subclasses.