Class KerberosTokenProvider

java.lang.Object
org.apache.gravitino.client.KerberosTokenProvider
All Implemented Interfaces:
Closeable, AutoCloseable

public final class KerberosTokenProvider extends Object
KerberosTokenProvider will get Kerberos token using GSS context negotiation and then provide the access token for every request.
  • Method Details

    • hasTokenData

      public boolean hasTokenData()
      Judge whether AuthDataProvider can provide token data.
      Returns:
      true if the AuthDataProvider can provide token data otherwise false.
    • getTokenData

      public byte[] getTokenData()
      Acquire the data of token for authentication. The client will set the token data as HTTP header Authorization directly. So the return value should ensure token data contain the token header (eg: Bearer, Basic) if necessary.
      Returns:
      the token data is used for authentication.
    • close

      public void close() throws IOException
      Closes the KerberosTokenProvider and releases any underlying resources.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • builder

      public static KerberosTokenProvider.Builder builder()
      Creates a new instance of the KerberosTokenProvider.Builder
      Returns:
      A new instance of KerberosTokenProvider.Builder