|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.seraph.filter.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
|
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 req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
|
protected Authenticator |
getAuthenticator()
|
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 request,
javax.servlet.http.HttpServletResponse response)
Performs the actual authentication (if required) and returns the status code. |
protected boolean |
redirectToOriginalDestination(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
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
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
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)
public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
java.io.IOException
javax.servlet.ServletException
public abstract java.lang.String login(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
request
- response
-
protected boolean redirectToOriginalDestination(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
request
- response
-
java.io.IOException
protected boolean isAbsoluteUrl(java.lang.String url)
protected Authenticator getAuthenticator()
protected SecurityConfig getSecurityConfig()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |