public abstract class AuthenticationFilter extends AccessControlFilter
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_SUCCESS_URL |
DEFAULT_LOGIN_URL, GET_METHOD, POST_METHOD
appliedPaths, pathMatcher
ALREADY_FILTERED_SUFFIX
filterConfig
Constructor and Description |
---|
AuthenticationFilter() |
Modifier and Type | Method and Description |
---|---|
String |
getSuccessUrl()
Returns the success url to use as the default location a user is sent after logging in.
|
protected boolean |
isAccessAllowed(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
Object mappedValue)
Determines whether the current subject is authenticated.
|
protected void |
issueSuccessRedirect(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Redirects to user to the previously attempted URL after a successful login.
|
void |
setSuccessUrl(String successUrl)
Sets the default/fallback success url to use as the default location a user is sent after logging in.
|
getLoginUrl, getSubject, isLoginRequest, onAccessDenied, onAccessDenied, onPreHandle, redirectToLogin, saveRequest, saveRequestAndRedirectToLogin, setLoginUrl
getPathWithinApplication, isEnabled, pathsMatch, pathsMatch, preHandle, processPathConfig
afterCompletion, cleanup, doFilterInternal, executeChain, postHandle
doFilter, getAlreadyFilteredAttributeName, isEnabled, isEnabled, setEnabled, shouldNotFilter
getName, setName, toStringBuilder
destroy, getFilterConfig, getInitParam, init, onFilterConfigSet, setFilterConfig
getContextAttribute, getContextInitParam, getServletContext, removeContextAttribute, setContextAttribute, setServletContext, toString
public static final String DEFAULT_SUCCESS_URL
public String getSuccessUrl()
DEFAULT_SUCCESS_URL
.public void setSuccessUrl(String successUrl)
DEFAULT_SUCCESS_URL
.successUrl
- the success URL to redirect the user to after a successful login.protected boolean isAccessAllowed(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, Object mappedValue)
acquires
the currently executing Subject and then returns
subject.isAuthenticated()
;isAccessAllowed
in class AccessControlFilter
request
- the incoming ServletRequest
response
- the outgoing ServletResponse
mappedValue
- the filter-specific config value mapped to this filter in the URL rules mappings.protected void issueSuccessRedirect(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws Exception
WebUtils
.redirectToSavedRequest
using the successUrl
as the fallbackUrl
argument to that call.request
- the incoming requestresponse
- the outgoing responseException
- if there is a problem redirecting.Copyright © 2004–2020 The Apache Software Foundation. All rights reserved.