Class AccessTokenProvider

java.lang.Object
org.apache.hadoop.hdfs.web.oauth2.AccessTokenProvider
All Implemented Interfaces:
Configurable
Direct Known Subclasses:
ConfRefreshTokenBasedAccessTokenProvider, CredentialBasedAccessTokenProvider

@Public @Evolving public abstract class AccessTokenProvider extends Object implements Configurable
Provide an OAuth2 access token to be used to authenticate http calls in WebHDFS.
  • Constructor Details

    • AccessTokenProvider

      public AccessTokenProvider()
  • Method Details

    • 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 Configuration getConf()
      Return the conf.
      Specified by:
      getConf in interface Configurable
      Returns:
      the conf.
    • setConf

      public void setConf(Configuration configuration)
      Set the conf.
      Specified by:
      setConf in interface Configurable
      Parameters:
      configuration - New configuration.