public class HttpBasicAuthenticationFilter extends PathMatchingFilter
Modifier and Type | Field and Description |
---|---|
protected static String |
AUTHORIZATION_HEADER
HTTP Authorization header, equal to
Authorization |
static String |
copyright |
appliedPaths, pathMatcher
ALREADY_FILTERED_SUFFIX
filterConfig
Constructor and Description |
---|
HttpBasicAuthenticationFilter() |
Modifier and Type | Method and Description |
---|---|
protected String |
getHost(ServletRequest request)
Returns the host name or IP associated with the current subject.
|
protected String[] |
getPrincipalsAndCredentials(String authorizationHeader)
Returns the username obtained from the authorization header.
|
protected boolean |
onPreHandle(ServletRequest request,
ServletResponse response,
Object mappedValue) |
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 copyright
protected static final String AUTHORIZATION_HEADER
Authorization
protected boolean onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception
onPreHandle
in class PathMatchingFilter
Exception
protected String getHost(ServletRequest request)
Returns the host name or IP associated with the current subject. This method is primarily provided for use
during construction of an AuthenticationToken
.
The default implementation merely returns ServletRequest.getRemoteHost()
.
request
- the incoming ServletRequestInetAddress
to associate with the login attempt.protected String[] getPrincipalsAndCredentials(String authorizationHeader)
Returns the username obtained from the authorization header.
Once the header is split per the RFC (based on the space character ' '), the resulting split tokens are translated into the username/password pair.
authorizationHeader
- the authorization header obtained from the request.