Package org.alfresco.web.scripts.servlet
Class X509ServletFilterBase
java.lang.Object
org.alfresco.web.scripts.servlet.X509ServletFilterBase
- All Implemented Interfaces:
javax.servlet.Filter
The X509ServletFilterBase enforces X509 Authentication.
Optional Init Param:
cert-contains : Ensure that the principal subject of the cert contains a specific string.
The X509ServletFilter will also ensure that the cert is present in the request, which will only happen if there
is a successful SSL handshake which includes client authentication. This handshake is handled by the Application Server.
A SSL handshake that does not include client Authentication will receive a 403 error response.
The checkInforce method must be implemented to determine if the X509 Authentication is turned on. This allows
applications to turn on/off X509 Authentication based on parameters outside of the web.xml.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
checkEnforce
(javax.servlet.ServletContext servletContext) void
destroy()
void
doFilter
(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) void
init
(javax.servlet.FilterConfig config) void
setHttpsPort
(int port)
-
Field Details
-
enforce
protected boolean enforce
-
-
Constructor Details
-
X509ServletFilterBase
public X509ServletFilterBase()
-
-
Method Details
-
init
public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException - Specified by:
init
in interfacejavax.servlet.Filter
- Throws:
javax.servlet.ServletException
-
setHttpsPort
public void setHttpsPort(int port) -
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException - Specified by:
doFilter
in interfacejavax.servlet.Filter
- Throws:
IOException
javax.servlet.ServletException
-
checkEnforce
protected abstract boolean checkEnforce(javax.servlet.ServletContext servletContext) throws IOException - Parameters:
servletContext
-- Returns:
- true if enforcing X509 false if not enforcing X509
- Throws:
IOException
- The checkInforce method is called during the initialization of the Filter. Implement this method to decide if X509 security is being enforced.
-
destroy
public void destroy()- Specified by:
destroy
in interfacejavax.servlet.Filter
-