java.lang.Object
org.codelibs.jcifs.smb1.http.NtlmHttpFilter
- All Implemented Interfaces:
jakarta.servlet.Filter
An HTTP servlet filter that provides NTLM authentication support for SMB1 protocol.
This filter allows web applications to authenticate users via NTLM/Windows authentication.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voiddoFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) This method simply callsnegotiate( req, resp, false )and thenchain.doFilter.jakarta.servlet.FilterConfigGets the filter configuration.voidinit(jakarta.servlet.FilterConfig filterConfig) protected NtlmPasswordAuthenticationnegotiate(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, boolean skipAuthentication) Negotiate password hashes with MSIE clients using NTLM SSPvoidsetFilterConfig(jakarta.servlet.FilterConfig f) Sets the filter configuration for WebLogic 6.1 compatibility.
-
Constructor Details
-
NtlmHttpFilter
public NtlmHttpFilter()Default constructor.
-
-
Method Details
-
init
public void init(jakarta.servlet.FilterConfig filterConfig) throws jakarta.servlet.ServletException - Specified by:
initin interfacejakarta.servlet.Filter- Throws:
jakarta.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroyin interfacejakarta.servlet.Filter
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException This method simply callsnegotiate( req, resp, false )and thenchain.doFilter. You can override and call negotiate manually to achive a variety of different behavior.- Specified by:
doFilterin interfacejakarta.servlet.Filter- Throws:
IOExceptionjakarta.servlet.ServletException
-
negotiate
protected NtlmPasswordAuthentication negotiate(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, boolean skipAuthentication) throws IOException, jakarta.servlet.ServletException Negotiate password hashes with MSIE clients using NTLM SSP- Parameters:
req- The servlet requestresp- The servlet responseskipAuthentication- If true the negotiation is only done if it is initiated by the client (MSIE post requests after successful NTLM SSP authentication). If false and the user has not been authenticated yet the client will be forced to send an authentication (server sends HttpServletResponse.SC_UNAUTHORIZED).- Returns:
- True if the negotiation is complete, otherwise false
- Throws:
IOException- if an I/O error occursjakarta.servlet.ServletException- if a servlet error occurs
-
setFilterConfig
public void setFilterConfig(jakarta.servlet.FilterConfig f) Sets the filter configuration for WebLogic 6.1 compatibility.- Parameters:
f- the filter configuration to set
-
getFilterConfig
public jakarta.servlet.FilterConfig getFilterConfig()Gets the filter configuration.- Returns:
- the filter configuration or null
-