public abstract class AbstractBasicAuthenticationHandler extends Object implements AuthenticationHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
AUTHENTICATION_SCHEME_BASIC |
protected static org.slf4j.Logger |
LOGGER |
static String |
SOURCE |
| Constructor and Description |
|---|
AbstractBasicAuthenticationHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected BaseAuthenticationToken |
extractAuthenticationInfo(javax.servlet.http.HttpServletRequest request) |
protected BaseAuthenticationToken |
extractAuthInfo(String authHeader,
String realm)
Extract the Authorization header and parse into a username/password token.
|
abstract String |
getAuthenticationType()
Authentication type String used to match this handler with the auth types configured for a
specific context.
|
protected abstract BaseAuthenticationToken |
getBaseAuthenticationToken(String realm,
String username,
String password) |
HandlerResult |
getNormalizedToken(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain,
boolean resolve)
Processes the incoming request to retrieve the username/password tokens.
|
HandlerResult |
handleError(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain chain)
Called when downstream authentication fails.
|
public static final String AUTHENTICATION_SCHEME_BASIC
public static final String SOURCE
protected static final org.slf4j.Logger LOGGER
public abstract String getAuthenticationType()
AuthenticationHandlergetAuthenticationType in interface AuthenticationHandlerpublic HandlerResult getNormalizedToken(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain, boolean resolve)
HandlerResult for the HTTP Request.getNormalizedToken in interface AuthenticationHandlerrequest - http request to obtain attributes from and to pass into any local filter chains
requiredresponse - http response to return http responses or redirectschain - original filter chain (should not be called from your handler)resolve - flag with true implying that credentials should be obtained, false implying
return if no credentials are found.public HandlerResult handleError(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain chain) throws javax.servlet.ServletException
AuthenticationHandlerhandleError in interface AuthenticationHandlerservletRequest - htt http response to return http responses or redirectsjavax.servlet.ServletExceptionprotected BaseAuthenticationToken extractAuthenticationInfo(javax.servlet.http.HttpServletRequest request)
protected BaseAuthenticationToken extractAuthInfo(String authHeader, String realm)
authHeader - the authHeader string from the HTTP requestprotected abstract BaseAuthenticationToken getBaseAuthenticationToken(String realm, String username, String password)
This work is licensed under a Creative Commons Attribution 4.0 International License.