Class CrowdSecurityFilter
java.lang.Object
com.atlassian.crowd.integration.http.filter.CrowdSecurityFilter
- All Implemented Interfaces:
javax.servlet.Filter
This filter manages protecting a
web.xml url-pattern. If the requesting user does
not have a valid token, they will be redirected to the authentication path specified in the crowd.properties
configuration file. Additional values are stored to the user's session such as their originally requested
URL should their authentication be found invalid.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe session key stored as aString, is the requested secure url before redirect to the authentication page. -
Constructor Summary
ConstructorsConstructorDescriptionCrowdSecurityFilter(CrowdHttpAuthenticator httpAuthenticator, AuthenticationUrlProvider authenticationUrlProvider) CrowdSecurityFilter(CrowdHttpAuthenticator httpAuthenticator, ClientProperties clientProperties) Constructs a CrowdSecurityFilter. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringauthenticationUrl(javax.servlet.http.HttpServletRequest request) Override this to alter the destination of the redirect to the authentication page.voiddestroy()Shuts down the filter.voiddoFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain) Executes the filter.voidinit(javax.servlet.FilterConfig filterConfig) Configures the filter.
-
Field Details
-
ORIGINAL_URL
The session key stored as aString, is the requested secure url before redirect to the authentication page.- See Also:
-
-
Constructor Details
-
CrowdSecurityFilter
public CrowdSecurityFilter(CrowdHttpAuthenticator httpAuthenticator, ClientProperties clientProperties) Constructs a CrowdSecurityFilter.- Parameters:
httpAuthenticator- CrowdHttpAuthenticatorclientProperties- ClientProperties
-
CrowdSecurityFilter
public CrowdSecurityFilter(CrowdHttpAuthenticator httpAuthenticator, AuthenticationUrlProvider authenticationUrlProvider)
-
-
Method Details
-
init
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException Configures the filter.- Specified by:
initin interfacejavax.servlet.Filter- Parameters:
filterConfig- theFilterConfigto use.- Throws:
javax.servlet.ServletException-Filterrelated problems.
-
destroy
public void destroy()Shuts down the filter.- Specified by:
destroyin interfacejavax.servlet.Filter
-
doFilter
public void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain) throws IOException, javax.servlet.ServletException Executes the filter.- Specified by:
doFilterin interfacejavax.servlet.Filter- Parameters:
servletRequest- theServletRequestto use.servletResponse- theServletResponseto use.filterChain- theFilterChainto use.- Throws:
IOException- I/O related problems.javax.servlet.ServletException-Servletrelated problems.
-
authenticationUrl
Override this to alter the destination of the redirect to the authentication page. The HTTP request is provided so as to allow access to the session.- Parameters:
request- the HTTP request.- Returns:
- the destination URL.
- See Also:
-
HttpServletResponse.sendRedirect(String)
-