Class SimpleAcceptOrRejectAllAuthenticationComponentImpl

  • All Implemented Interfaces:
    AuthenticationComponent, AuthenticationContext

    public class SimpleAcceptOrRejectAllAuthenticationComponentImpl
    extends AbstractAuthenticationComponent
    This implementation of an AuthenticationComponent can be configured to accept or reject all attempts to login. This only affects attempts to login using a user name and password. Authentication filters etc. could still support authentication but not via user names and passwords. For example, where they set the current user using the authentication component. Then the current user is set in the security context and asserted to be authenticated. By default, the implementation rejects all authentication attempts.
    Author:
    Andy Hind
    • Constructor Detail

      • SimpleAcceptOrRejectAllAuthenticationComponentImpl

        public SimpleAcceptOrRejectAllAuthenticationComponentImpl()
    • Method Detail

      • setAuthenticationDao

        public void setAuthenticationDao​(net.sf.acegisecurity.providers.dao.AuthenticationDao authenticationDao)
      • setAccept

        public void setAccept​(boolean accept)
      • authenticateImpl

        public void authenticateImpl​(java.lang.String userName,
                                     char[] password)
                              throws org.alfresco.repo.security.authentication.AuthenticationException
        Description copied from class: AbstractAuthenticationComponent
        Default unsupported authentication implementation - as of 2.1 this is the best way to implement your own authentication component as it will support guest login - prior to this direct over ride for authenticate(String , char[]) was used. This will still work.
        Overrides:
        authenticateImpl in class AbstractAuthenticationComponent
        Parameters:
        userName - String
        password - char[]
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • getMD4HashedPassword

        public java.lang.String getMD4HashedPassword​(java.lang.String userName)
      • authenticate

        public net.sf.acegisecurity.Authentication authenticate​(net.sf.acegisecurity.Authentication token)
                                                         throws org.alfresco.repo.security.authentication.AuthenticationException
        The default is not to support Authentication token base authentication
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • getUserDetails

        protected net.sf.acegisecurity.UserDetails getUserDetails​(java.lang.String userName)
        We actually have an acegi object so override the default method.
        Overrides:
        getUserDetails in class AbstractAuthenticationComponent
        Parameters:
        userName - String
        Returns:
        UserDetails