Class AbstractJaasAuthenticationProvider

    • Field Detail

      • log

        protected final org.apache.commons.logging.Log log
    • Constructor Detail

      • AbstractJaasAuthenticationProvider

        public AbstractJaasAuthenticationProvider()
    • Method Detail

      • authenticate

        public Authentication authenticate​(Authentication auth)
                                    throws AuthenticationException
        Attempts to login the user given the Authentication objects principal and credential
        Specified by:
        authenticate in interface AuthenticationProvider
        auth - The Authentication object to be authenticated.
        The authenticated Authentication object, with it's grantedAuthorities set.
        AuthenticationException - This implementation does not handle 'locked' or 'disabled' accounts. This method only throws a AuthenticationServiceException, with the message of the LoginException that will be thrown, should the loginContext.login() method fail.
      • createLoginContext

        protected abstract createLoginContext​( handler)
        Creates the LoginContext to be used for authentication.
        handler - The CallbackHandler that should be used for the LoginContext (never null).
        the LoginContext to use for authentication.
      • handleLogout

        protected void handleLogout​(SessionDestroyedEvent event)
        Handles the logout by getting the security contexts for the destroyed session and invoking LoginContext.logout() for any which contain a JaasAuthenticationToken.
        event - the session event which contains the current session
      • setAuthorityGranters

        public void setAuthorityGranters​(AuthorityGranter[] authorityGranters)
        Set the AuthorityGranters that should be consulted for role names to be granted to the Authentication.
        authorityGranters - AuthorityGranter array
        See Also:
      • setCallbackHandlers

        public void setCallbackHandlers​(JaasAuthenticationCallbackHandler[] callbackHandlers)
        Set the JAASAuthentcationCallbackHandler array to handle callback objects generated by the LoginContext.login method.
        callbackHandlers - Array of JAASAuthenticationCallbackHandlers
      • setLoginContextName

        public void setLoginContextName​(java.lang.String loginContextName)
        Set the loginContextName, this name is used as the index to the configuration specified in the loginConfig property.
        loginContextName -
      • setLoginExceptionResolver

        public void setLoginExceptionResolver​(LoginExceptionResolver loginExceptionResolver)
      • supports

        public boolean supports​(java.lang.Class<?> aClass)
        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
        true if the implementation can more closely evaluate the Authentication class presented
      • setApplicationEventPublisher

        public void setApplicationEventPublisher​(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
        Specified by:
        setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAware
      • getApplicationEventPublisher

        protected org.springframework.context.ApplicationEventPublisher getApplicationEventPublisher()