org.apache.hadoop.hdfs.web.oauth2

## Class ConfRefreshTokenBasedAccessTokenProvider

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

- All Implemented Interfaces:
    org.apache.hadoop.conf.Configurable

      @InterfaceAudience.Public
       @InterfaceStability.Evolving
      public class ConfRefreshTokenBasedAccessTokenProvider
      extends AccessTokenProvider

  Supply a access token obtained via a refresh token (provided through the Configuration using the second half of the Authorization Code Grant workflow.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `OAUTH_REFRESH_TOKEN_EXPIRES_KEY`
    `static String` | `OAUTH_REFRESH_TOKEN_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfRefreshTokenBasedAccessTokenProvider()`
    `ConfRefreshTokenBasedAccessTokenProvider(org.apache.hadoop.util.Timer timer)`

  - ### Method Summary

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

    - ### Methods inherited from class org.apache.hadoop.hdfs.web.oauth2.AccessTokenProvider

      `getConf`

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

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

- - ### Field Detail

    - #### OAUTH_REFRESH_TOKEN_KEY

          public static final String OAUTH_REFRESH_TOKEN_KEY

      See Also:
        Constant Field Values

    - #### OAUTH_REFRESH_TOKEN_EXPIRES_KEY

          public static final String OAUTH_REFRESH_TOKEN_EXPIRES_KEY

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ConfRefreshTokenBasedAccessTokenProvider

          public ConfRefreshTokenBasedAccessTokenProvider()

    - #### ConfRefreshTokenBasedAccessTokenProvider

          public ConfRefreshTokenBasedAccessTokenProvider(org.apache.hadoop.util.Timer timer)

  - ### Method Detail

    - #### setConf

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

      Description copied from class: `AccessTokenProvider`
      Set the conf.
      Specified by:
        `setConf` in interface `org.apache.hadoop.conf.Configurable`
      Overrides:
        `setConf` in class `AccessTokenProvider`
      Parameters:
        `conf` - New configuration.

    - #### getAccessToken

          public String getAccessToken()
                                throws IOException

      Description copied from class: `AccessTokenProvider`
      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.
      Specified by:
        `getAccessToken` in class `AccessTokenProvider`
      Returns:
        Access token to be added to connection header.
      Throws:
        `IOException`

    - #### getRefreshToken

          public String getRefreshToken()

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