|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.seraph.filter.BaseLoginFilter
public abstract class BaseLoginFilter
This is a base authentication filter. It delegates the actual login process to a child class but takes care of the redirection process.
If the authentication is successful, the user will be redirected by the filter to the URL given by the session attribute at SecurityFilter.ORIGINAL_URL_KEY. If this URL doesn't exist, it will look for a parameter 'os_destination' to use as the redirected URL instead. If neither is found, it is assumed that the page will check the authorisation status and handle redirection itself. From the any other filter in the request, or the servlet/JSP/action which processes the request, you can look up the status of the authorisation attempt. The status is a String request attribute, with the key 'os_authstatus'. The possible statuses are:
Field Summary | |
---|---|
protected static String |
ALREADY_FILTERED
Deprecated. use SecurityUtils.isSeraphFilteringDisabled(javax.servlet.ServletRequest) or SecurityUtils.disableSeraphFiltering(javax.servlet.ServletRequest) |
static String |
AUTHENTICATION_ERROR_TYPE
|
static String |
LOGIN_ERROR
|
static String |
LOGIN_FAILED
|
static String |
LOGIN_NOATTEMPT
|
static String |
LOGIN_SUCCESS
|
static String |
OS_AUTHSTATUS_KEY
|
Constructor Summary | |
---|---|
BaseLoginFilter()
|
Method Summary | |
---|---|
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
|
protected AuthenticationContext |
getAuthenticationContext()
|
protected Authenticator |
getAuthenticator()
|
protected ElevatedSecurityGuard |
getElevatedSecurityGuard()
|
javax.servlet.FilterConfig |
getFilterConfig()
Deprecated. Not needed in latest version of Servlet 2.3 API |
protected SecurityConfig |
getSecurityConfig()
|
void |
init(javax.servlet.FilterConfig config)
|
protected boolean |
isAbsoluteUrl(String url)
|
abstract String |
login(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
Performs the actual authentication (if required) and returns the status code. |
protected boolean |
redirectToOriginalDestination(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
Redirect the response to the original destination if present |
void |
setFilterConfig(javax.servlet.FilterConfig filterConfig)
Deprecated. Not needed in latest version of Servlet 2.3 API - replaced by init(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String ALREADY_FILTERED
SecurityUtils.isSeraphFilteringDisabled(javax.servlet.ServletRequest)
or SecurityUtils.disableSeraphFiltering(javax.servlet.ServletRequest)
public static final String LOGIN_SUCCESS
public static final String LOGIN_FAILED
public static final String LOGIN_ERROR
public static final String LOGIN_NOATTEMPT
public static final String OS_AUTHSTATUS_KEY
public static final String AUTHENTICATION_ERROR_TYPE
Constructor Detail |
---|
public BaseLoginFilter()
Method Detail |
---|
public void init(javax.servlet.FilterConfig config)
init
in interface javax.servlet.Filter
public void destroy()
destroy
in interface javax.servlet.Filter
public javax.servlet.FilterConfig getFilterConfig()
public void setFilterConfig(javax.servlet.FilterConfig filterConfig)
filterConfig
- a FilterConfigpublic void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
public abstract String login(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
AUTHENTICATION_ERROR_TYPE
and a type of AuthenticationErrorType
in
order to indicate the type of error.
httpServletRequest
- the HTTP request in playhttpServletResponse
- the HTTP response in play
protected boolean redirectToOriginalDestination(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws IOException
httpServletRequest
- the HTTP request in playhttpServletResponse
- the HTTP response in play
IOException
- If the redirect throws IOException. See HttpServletResponse.sendRedirect(String)
protected boolean isAbsoluteUrl(String url)
protected Authenticator getAuthenticator()
protected ElevatedSecurityGuard getElevatedSecurityGuard()
protected SecurityConfig getSecurityConfig()
protected AuthenticationContext getAuthenticationContext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |