javax.servlet.Filter@Private
@Evolving
public class DelegationTokenAuthenticationFilter
extends org.apache.hadoop.security.authentication.server.AuthenticationFilter
DelegationTokenAuthenticationFilter filter is a
AuthenticationFilter with Hadoop Delegation Token support.
By default it uses it own instance of the AbstractDelegationTokenSecretManager. For situations where an external
AbstractDelegationTokenSecretManager is required (i.e. one that
shares the secret with AbstractDelegationTokenSecretManager
instance running in other services), the external
AbstractDelegationTokenSecretManager must be set as an
attribute in the ServletContext of the web application using the
DELEGATION_TOKEN_SECRET_MANAGER_ATTR attribute name (
'hadoop.http.delegation-token-secret-manager').
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
DELEGATION_TOKEN_SECRET_MANAGER_ATTR |
Sets an external
DelegationTokenSecretManager instance to
manage creation and verification of Delegation Tokens. |
static java.lang.String |
PROXYUSER_PREFIX |
ACTION_PARAM, AUTH_TOKEN_MAX_INACTIVE_INTERVAL, AUTH_TOKEN_VALIDITY, AUTH_TYPE, CONFIG_PREFIX, configPrefix, COOKIE_DOMAIN, COOKIE_PATH, COOKIE_PERSISTENT, SIGNATURE_SECRET, SIGNATURE_SECRET_FILE, SIGNER_SECRET_PROVIDER, SIGNER_SECRET_PROVIDER_ATTRIBUTE, SSO_LOGIN_COOKIE| Constructor | Description |
|---|---|
DelegationTokenAuthenticationFilter() |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
doFilter(javax.servlet.FilterChain filterChain,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
|
protected java.util.Properties |
getConfiguration(java.lang.String configPrefix,
javax.servlet.FilterConfig filterConfig) |
It delegates to
AuthenticationFilter.getConfiguration(String, FilterConfig) and
then overrides the AuthenticationHandler to use if authentication
type is set to simple or kerberos in order to use
the corresponding implementation with delegation token support. |
protected Configuration |
getProxyuserConfiguration(javax.servlet.FilterConfig filterConfig) |
Returns the proxyuser configuration.
|
void |
init(javax.servlet.FilterConfig filterConfig) |
|
protected void |
initializeAuthHandler(java.lang.String authHandlerClassName,
javax.servlet.FilterConfig filterConfig) |
|
protected void |
setAuthHandlerClass(java.util.Properties props) |
Set AUTH_TYPE property to the name of the corresponding authentication
handler class based on the input properties.
|
protected void |
setHandlerAuthMethod(SaslRpcServer.AuthMethod authMethod) |
constructSecretProvider, createAuthCookie, destroy, doFilter, getAuthenticationHandler, getAuthUrl, getConfiguration, getCookieDomain, getCookiePath, getCookieTokenName, getLogoutUrl, getMaxInactiveInterval, getRequestURL, getToken, getValidity, initializeSecretProvider, isCookiePersistent, isCustomSignerSecretProvider, isRandomSecret, verifyTokenTypepublic static final java.lang.String DELEGATION_TOKEN_SECRET_MANAGER_ATTR
DelegationTokenSecretManager instance to
manage creation and verification of Delegation Tokens.
This is useful for use cases where secrets must be shared across multiple services.
public static final java.lang.String PROXYUSER_PREFIX
protected java.util.Properties getConfiguration(java.lang.String configPrefix,
javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
AuthenticationFilter.getConfiguration(String, FilterConfig) and
then overrides the AuthenticationHandler to use if authentication
type is set to simple or kerberos in order to use
the corresponding implementation with delegation token support.getConfiguration in class org.apache.hadoop.security.authentication.server.AuthenticationFilterconfigPrefix - parameter not used.filterConfig - parameter not used.javax.servlet.ServletExceptionprotected void setAuthHandlerClass(java.util.Properties props)
throws javax.servlet.ServletException
props - input properties.javax.servlet.ServletException - servlet exception.protected Configuration getProxyuserConfiguration(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
proxyuser.'
Subclasses may override this method if the proxyuser configuration is read from other place than the filter init parameters.
filterConfig - filter configuration objectjavax.servlet.ServletException - thrown if the configuration could not be created.public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
init in interface javax.servlet.Filterinit in class org.apache.hadoop.security.authentication.server.AuthenticationFilterjavax.servlet.ServletExceptionprotected void initializeAuthHandler(java.lang.String authHandlerClassName,
javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
initializeAuthHandler in class org.apache.hadoop.security.authentication.server.AuthenticationFilterjavax.servlet.ServletExceptionprotected void setHandlerAuthMethod(SaslRpcServer.AuthMethod authMethod)
protected void doFilter(javax.servlet.FilterChain filterChain,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException
doFilter in class org.apache.hadoop.security.authentication.server.AuthenticationFilterjava.io.IOExceptionjavax.servlet.ServletExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.