com.atlassian.crowd.openid.client.filter
Class VerifyOpenIDAuthenticationFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
com.atlassian.crowd.openid.client.filter.VerifyOpenIDAuthenticationFilter
- All Implemented Interfaces:
- javax.servlet.Filter, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.EnvironmentAware, org.springframework.web.context.ServletContextAware
public class VerifyOpenIDAuthenticationFilter
- extends org.springframework.web.filter.OncePerRequestFilter
Checks if web-user is authenticated. If they are not redirect them to the login page.
This filter is run once per request.
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter |
ALREADY_FILTERED_SUFFIX |
Method Summary |
protected void |
doFilterInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain filterChain)
Verifies the user is authenticated, otherwise redirects them to the login screen
with the ORIGINAL_URL appropriately set to the secure page they were trying to
access. |
protected String |
getOringinalURL(javax.servlet.http.HttpServletRequest request)
Stores the URL the user was originally requesting. |
protected boolean |
isAuthenticated(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Checks if a principal is authenticated. |
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter |
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter |
Methods inherited from class org.springframework.web.filter.GenericFilterBean |
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ORIGINAL_URL
public static final String ORIGINAL_URL
- The session key stored as a
String, is the requested secure url before redirect to the authentication
page.
AUTHENTICATED_PRINCIPAL_SESSION_KEY
public static final String AUTHENTICATED_PRINCIPAL_SESSION_KEY
VerifyOpenIDAuthenticationFilter
public VerifyOpenIDAuthenticationFilter()
isAuthenticated
protected boolean isAuthenticated(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
- Checks if a principal is authenticated.
- Parameters:
request
- The HTTP request.response
- The HTTP response.
- Returns:
true
if and only if the principal is authenticated, otherwise false
.
- Throws:
IOException
- I/O related problems.
javax.servlet.ServletException
- Servlet
related problems.
getOringinalURL
protected String getOringinalURL(javax.servlet.http.HttpServletRequest request)
- Stores the URL the user was originally requesting.
- Parameters:
request
- The HTTP request.
- Returns:
- The requested URL.
doFilterInternal
protected void doFilterInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain filterChain)
throws javax.servlet.ServletException,
IOException
- Verifies the user is authenticated, otherwise redirects them to the login screen
with the ORIGINAL_URL appropriately set to the secure page they were trying to
access.
- Specified by:
doFilterInternal
in class org.springframework.web.filter.OncePerRequestFilter
- Parameters:
request
- HttpServletRequestresponse
- HttpServletResponsefilterChain
- FilterChain
- Throws:
javax.servlet.ServletException
- if an error occurs while processing filter chain or sending a redirect to the login screen
IOException
- if an error occurs while processing filter chain or sending a redirect to the login screen
Copyright © 2013 Atlassian. All Rights Reserved.