DelegationTokenManager (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.security.token.delegation.web, class: DelegationTokenManager

Package org.apache.hadoop.security.token.delegation.web

# Class DelegationTokenManager

java.lang.Object
org.apache.hadoop.security.token.delegation.web.DelegationTokenManager

@Private @Evolving public class DelegationTokenManager extends Object
Delegation Token Manager used by the `KerberosDelegationTokenAuthenticationHandler`.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ENABLE_ZK_KEY`
  `static final String`
  `MAX_LIFETIME`
  `static final long`
  `MAX_LIFETIME_DEFAULT`
  `static final String`
  `PREFIX`
  `static final String`
  `REMOVAL_SCAN_INTERVAL`
  `static final long`
  `REMOVAL_SCAN_INTERVAL_DEFAULT`
  `static final String`
  `RENEW_INTERVAL`
  `static final long`
  `RENEW_INTERVAL_DEFAULT`
  `static final String`
  `UPDATE_INTERVAL`
  `static final long`
  `UPDATE_INTERVAL_DEFAULT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DelegationTokenManager(Configuration conf, Text tokenKind)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `cancelToken(Token<? extends AbstractDelegationTokenIdentifier> token, String canceler)`
  `Token<? extends AbstractDelegationTokenIdentifier>`
  `createToken(UserGroupInformation ugi, String renewer)`
  `Token<? extends AbstractDelegationTokenIdentifier>`
  `createToken(UserGroupInformation ugi, String renewer, String service)`
  `void`
  `destroy()`
  `AbstractDelegationTokenSecretManager`
  `getDelegationTokenSecretManager()`
  `void`
  `init()`
  `long`
  `renewToken(Token<? extends AbstractDelegationTokenIdentifier> token, String renewer)`
  `void`
  `setExternalDelegationTokenSecretManager(AbstractDelegationTokenSecretManager secretManager)`
  Sets an external `DelegationTokenSecretManager` instance to manage creation and verification of Delegation Tokens.
  `UserGroupInformation`
  `verifyToken(Token<? extends AbstractDelegationTokenIdentifier> token)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### ENABLE_ZK_KEY

    public static final String ENABLE_ZK_KEY
    See Also:
      - Constant Field Values

  - ### PREFIX

    public static final String PREFIX
    See Also:
      - Constant Field Values

  - ### UPDATE_INTERVAL

    public static final String UPDATE_INTERVAL
    See Also:
      - Constant Field Values

  - ### UPDATE_INTERVAL_DEFAULT

    public static final long UPDATE_INTERVAL_DEFAULT
    See Also:
      - Constant Field Values

  - ### MAX_LIFETIME

    public static final String MAX_LIFETIME
    See Also:
      - Constant Field Values

  - ### MAX_LIFETIME_DEFAULT

    public static final long MAX_LIFETIME_DEFAULT
    See Also:
      - Constant Field Values

  - ### RENEW_INTERVAL

    public static final String RENEW_INTERVAL
    See Also:
      - Constant Field Values

  - ### RENEW_INTERVAL_DEFAULT

    public static final long RENEW_INTERVAL_DEFAULT
    See Also:
      - Constant Field Values

  - ### REMOVAL_SCAN_INTERVAL

    public static final String REMOVAL_SCAN_INTERVAL
    See Also:
      - Constant Field Values

  - ### REMOVAL_SCAN_INTERVAL_DEFAULT

    public static final long REMOVAL_SCAN_INTERVAL_DEFAULT
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### DelegationTokenManager

    public DelegationTokenManager(Configuration conf, Text tokenKind)

- ## Method Details

  - ### setExternalDelegationTokenSecretManager

    public void setExternalDelegationTokenSecretManager(AbstractDelegationTokenSecretManager secretManager)
    Sets an external `DelegationTokenSecretManager` instance to manage creation and verification of Delegation Tokens.

    This is useful for use cases where secrets must be shared across multiple services.

    Parameters:
      `secretManager` - a `DelegationTokenSecretManager` instance

  - ### init

    public void init()

  - ### destroy

    public void destroy()

  - ### createToken

    public Token<? extends AbstractDelegationTokenIdentifier> createToken(UserGroupInformation ugi, String renewer)

  - ### createToken

    public Token<? extends AbstractDelegationTokenIdentifier> createToken(UserGroupInformation ugi, String renewer, String service)

  - ### renewToken

    public long renewToken(Token<? extends AbstractDelegationTokenIdentifier> token, String renewer) throws IOException
    Throws:
      `IOException`

  - ### cancelToken

    public void cancelToken(Token<? extends AbstractDelegationTokenIdentifier> token, String canceler) throws IOException
    Throws:
      `IOException`

  - ### verifyToken

    public UserGroupInformation verifyToken(Token<? extends AbstractDelegationTokenIdentifier> token) throws IOException
    Throws:
      `IOException`

  - ### getDelegationTokenSecretManager

    @VisibleForTesting public AbstractDelegationTokenSecretManager getDelegationTokenSecretManager()