Class BaseNTLMAuthenticationFilter

    • Constructor Detail

      • BaseNTLMAuthenticationFilter

        public BaseNTLMAuthenticationFilter()
    • Method Detail

      • setMapUnknownUserToGuest

        public void setMapUnknownUserToGuest​(boolean mapUnknownUserToGuest)
        Parameters:
        mapUnknownUserToGuest - should an unknown user be mapped to guest?
      • authenticateRequest

        public boolean authenticateRequest​(javax.servlet.ServletContext context,
                                           javax.servlet.http.HttpServletRequest sreq,
                                           javax.servlet.http.HttpServletResponse sresp)
                                    throws IOException,
                                           javax.servlet.ServletException
        Description copied from interface: AuthenticationDriver
        Authenticate user based on information in http request such as Authorization header or cached session information.
        Parameters:
        context - the context
        sreq - http request
        sresp - http response
        Returns:
        true if authentication was successful
        Throws:
        IOException
        javax.servlet.ServletException
      • processType1

        protected void processType1​(org.alfresco.jlan.server.auth.ntlm.Type1NTLMMessage type1Msg,
                                    javax.servlet.http.HttpServletRequest req,
                                    javax.servlet.http.HttpServletResponse res)
                             throws IOException
        Process a type 1 NTLM message
        Parameters:
        type1Msg - Type1NTLMMessage
        req - HttpServletRequest
        res - HttpServletResponse
        Throws:
        IOException
      • processType3

        protected boolean processType3​(org.alfresco.jlan.server.auth.ntlm.Type3NTLMMessage type3Msg,
                                       javax.servlet.ServletContext context,
                                       javax.servlet.http.HttpServletRequest req,
                                       javax.servlet.http.HttpServletResponse res)
                                throws IOException,
                                       javax.servlet.ServletException
        Process a type 3 NTLM message
        Parameters:
        type3Msg - Type3NTLMMessage
        req - HttpServletRequest
        res - HttpServletResponse
        Throws:
        IOException
        javax.servlet.ServletException
      • validateLocalHashedPassword

        protected boolean validateLocalHashedPassword​(org.alfresco.jlan.server.auth.ntlm.Type3NTLMMessage type3Msg,
                                                      org.alfresco.jlan.server.auth.ntlm.NTLMLogonDetails ntlmDetails,
                                                      boolean authenticated,
                                                      String md4hash)
        Validate the MD4 hash against local password
        Parameters:
        type3Msg - Type3NTLMMessage
        ntlmDetails - NTLMLogonDetails
        authenticated - boolean
        md4hash - String
        Returns:
        true if password hash is valid, false otherwise
      • checkNTLMv1

        protected final boolean checkNTLMv1​(String md4hash,
                                            byte[] challenge,
                                            org.alfresco.jlan.server.auth.ntlm.Type3NTLMMessage type3Msg,
                                            boolean checkLMHash)
        Perform an NTLMv1 hashed password check
        Parameters:
        md4hash - String
        challenge - byte[]
        type3Msg - Type3NTLMMessage
        checkLMHash - boolean
        Returns:
        boolean
      • checkNTLMv2

        protected final boolean checkNTLMv2​(String md4hash,
                                            byte[] challenge,
                                            org.alfresco.jlan.server.auth.ntlm.Type3NTLMMessage type3Msg)
        Perform an NTLMv2 check
        Parameters:
        md4hash - String
        challenge - byte[]
        type3Msg - Type3NTLMMessage
        Returns:
        boolean
      • checkNTLMv2SessionKey

        protected final boolean checkNTLMv2SessionKey​(String md4hash,
                                                      byte[] challenge,
                                                      org.alfresco.jlan.server.auth.ntlm.Type3NTLMMessage type3Msg)
        Perform an NTLMv2 session key check
        Parameters:
        md4hash - String
        challenge - byte[]
        type3Msg - Type3NTLMMessage
        Returns:
        boolean
      • getMD4Hash

        protected String getMD4Hash​(String userName)
        Get the stored MD4 hashed password for the user, or null if the user does not exist
        Parameters:
        userName - String
        Returns:
        MD4 hash or null
      • restartLoginChallenge

        public void restartLoginChallenge​(javax.servlet.ServletContext context,
                                          javax.servlet.http.HttpServletRequest req,
                                          javax.servlet.http.HttpServletResponse res)
                                   throws IOException
        Restart the NTLM logon process
        Parameters:
        context - ServletContext
        req - HttpServletRequest
        res - SessHttpServletResponse
        Throws:
        IOException
      • disableNTLMv2

        protected final void disableNTLMv2()
        Disable NTLMv2 support, must be called from the implementation constructor