org.apache.hadoop.hdfs.web.oauth2

## Class AccessTokenProvider

- java.lang.Object
- - org.apache.hadoop.hdfs.web.oauth2.AccessTokenProvider

- All Implemented Interfaces:
    org.apache.hadoop.conf.Configurable
  Direct Known Subclasses:
    ConfRefreshTokenBasedAccessTokenProvider, CredentialBasedAccessTokenProvider

      @InterfaceAudience.Public
       @InterfaceStability.Evolving
      public abstract class AccessTokenProvider
      extends Object
      implements org.apache.hadoop.conf.Configurable

  Provide an OAuth2 access token to be used to authenticate http calls in WebHDFS.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AccessTokenProvider()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract String` | `getAccessToken()` Obtain the access token that should be added to http connection's header.
    `org.apache.hadoop.conf.Configuration` | `getConf()` Return the conf.
    `void` | `setConf(org.apache.hadoop.conf.Configuration configuration)` Set the conf.

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

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

- - ### Constructor Detail

    - #### AccessTokenProvider

          public AccessTokenProvider()

  - ### Method Detail

    - #### getAccessToken

          public abstract String getAccessToken()
                                         throws IOException

      Obtain the access token that should be added to http connection's header. Will be called for each connection, so implementations should be performant. Implementations are responsible for any refreshing of the token.
      Returns:
        Access token to be added to connection header.
      Throws:
        `IOException`

    - #### getConf

          public org.apache.hadoop.conf.Configuration getConf()

      Return the conf.
      Specified by:
        `getConf` in interface `org.apache.hadoop.conf.Configurable`
      Returns:
        the conf.

    - #### setConf

          public void setConf(org.apache.hadoop.conf.Configuration configuration)

      Set the conf.
      Specified by:
        `setConf` in interface `org.apache.hadoop.conf.Configurable`
      Parameters:
        `configuration` - New configuration.

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.