org.apache.hadoop.security.authentication.server.AuthenticationHandlerKerberosDelegationTokenAuthenticationHandler, MaprDelegationTokenAuthenticationHandler, MultiSchemeDelegationTokenAuthenticationHandler, PseudoDelegationTokenAuthenticationHandler@Private
@Evolving
public abstract class DelegationTokenAuthenticationHandler
extends java.lang.Object
implements org.apache.hadoop.security.authentication.server.AuthenticationHandler
AuthenticationHandler that implements Kerberos SPNEGO mechanism
for HTTP and supports Delegation Token functionality.
In addition to the wrapped AuthenticationHandler configuration
properties, this handler supports the following properties prefixed
with the type of the wrapped AuthenticationHandler:
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
DELEGATION_TOKEN_UGI_ATTRIBUTE |
|
static java.lang.String |
JSON_MAPPER_PREFIX |
|
static java.lang.String |
PREFIX |
|
static java.lang.String |
TOKEN_KIND |
|
protected static java.lang.String |
TYPE_POSTFIX |
| Constructor | Description |
|---|---|
DelegationTokenAuthenticationHandler(org.apache.hadoop.security.authentication.server.AuthenticationHandler handler) |
| Modifier and Type | Method | Description |
|---|---|---|
org.apache.hadoop.security.authentication.server.AuthenticationToken |
authenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
Authenticates a request looking for the
delegation
query-string parameter and verifying it is a valid token. |
void |
destroy() |
|
java.lang.String |
getType() |
|
void |
init(java.util.Properties config) |
|
void |
initJsonFactory(java.util.Properties config) |
|
void |
initTokenManager(java.util.Properties config) |
|
protected boolean |
isManagementOperation(javax.servlet.http.HttpServletRequest request) |
This method checks if the given HTTP request corresponds to a management
operation.
|
boolean |
managementOperation(org.apache.hadoop.security.authentication.server.AuthenticationToken token,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
|
void |
setExternalDelegationTokenSecretManager(AbstractDelegationTokenSecretManager secretManager) |
Sets an external
DelegationTokenSecretManager instance to
manage creation and verification of Delegation Tokens. |
protected static final java.lang.String TYPE_POSTFIX
public static final java.lang.String PREFIX
public static final java.lang.String TOKEN_KIND
public static final java.lang.String DELEGATION_TOKEN_UGI_ATTRIBUTE
public static final java.lang.String JSON_MAPPER_PREFIX
public DelegationTokenAuthenticationHandler(org.apache.hadoop.security.authentication.server.AuthenticationHandler handler)
public void init(java.util.Properties config)
throws javax.servlet.ServletException
init in interface org.apache.hadoop.security.authentication.server.AuthenticationHandlerjavax.servlet.ServletExceptionpublic void setExternalDelegationTokenSecretManager(AbstractDelegationTokenSecretManager secretManager)
DelegationTokenSecretManager instance to
manage creation and verification of Delegation Tokens.
This is useful for use cases where secrets must be shared across multiple services.
secretManager - a DelegationTokenSecretManager instance@VisibleForTesting public void initTokenManager(java.util.Properties config)
@VisibleForTesting public void initJsonFactory(java.util.Properties config)
public void destroy()
destroy in interface org.apache.hadoop.security.authentication.server.AuthenticationHandlerpublic java.lang.String getType()
getType in interface org.apache.hadoop.security.authentication.server.AuthenticationHandlerprotected final boolean isManagementOperation(javax.servlet.http.HttpServletRequest request)
throws java.io.IOException
request - The HTTP requestjava.io.IOException - In case of I/O error.public boolean managementOperation(org.apache.hadoop.security.authentication.server.AuthenticationToken token,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException,
org.apache.hadoop.security.authentication.client.AuthenticationException
managementOperation in interface org.apache.hadoop.security.authentication.server.AuthenticationHandlerjava.io.IOExceptionorg.apache.hadoop.security.authentication.client.AuthenticationExceptionpublic org.apache.hadoop.security.authentication.server.AuthenticationToken authenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException,
org.apache.hadoop.security.authentication.client.AuthenticationException
delegation
query-string parameter and verifying it is a valid token. If there is not
delegation query-string parameter, it delegates the
authentication to the KerberosAuthenticationHandler unless it is
disabled.authenticate in interface org.apache.hadoop.security.authentication.server.AuthenticationHandlerrequest - the HTTP client request.response - the HTTP client response.java.io.IOException - thrown if an IO error occurred.org.apache.hadoop.security.authentication.client.AuthenticationException - thrown if the authentication failed.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.