|
||||||||||
| 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 java.lang.String |
ALREADY_FILTERED
Deprecated. use SecurityUtils.isSeraphFilteringDisabled(javax.servlet.ServletRequest) or SecurityUtils.disableSeraphFiltering(javax.servlet.ServletRequest) |
static java.lang.String |
AUTHENTICATION_ERROR_TYPE
|
static java.lang.String |
LOGIN_ERROR
|
static java.lang.String |
LOGIN_FAILED
|
static java.lang.String |
LOGIN_NOATTEMPT
|
static java.lang.String |
LOGIN_SUCCESS
|
static java.lang.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(java.lang.String url)
|
abstract java.lang.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 java.lang.String ALREADY_FILTERED
SecurityUtils.isSeraphFilteringDisabled(javax.servlet.ServletRequest) or SecurityUtils.disableSeraphFiltering(javax.servlet.ServletRequest)public static final java.lang.String LOGIN_SUCCESS
public static final java.lang.String LOGIN_FAILED
public static final java.lang.String LOGIN_ERROR
public static final java.lang.String LOGIN_NOATTEMPT
public static final java.lang.String OS_AUTHSTATUS_KEY
public static final java.lang.String AUTHENTICATION_ERROR_TYPE
| Constructor Detail |
|---|
public BaseLoginFilter()
| Method Detail |
|---|
public void init(javax.servlet.FilterConfig config)
init in interface javax.servlet.Filterpublic void destroy()
destroy in interface javax.servlet.Filterpublic javax.servlet.FilterConfig getFilterConfig()
public void setFilterConfig(javax.servlet.FilterConfig filterConfig)
filterConfig - a FilterConfig
public void doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
throws java.io.IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.Filterjava.io.IOException
javax.servlet.ServletException
public abstract java.lang.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 java.io.IOException
httpServletRequest - the HTTP request in playhttpServletResponse - the HTTP response in play
java.io.IOException - If the redirect throws IOException. See HttpServletResponse.sendRedirect(String)protected boolean isAbsoluteUrl(java.lang.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 | |||||||||