Class BearerTokenProvider

java.lang.Object
land.oras.auth.BearerTokenProvider
All Implemented Interfaces:
AuthProvider

@NullMarked public final class BearerTokenProvider extends Object implements AuthProvider
A provider for bearer token authentication
  • Constructor Details

    • BearerTokenProvider

      public BearerTokenProvider()
      Create a new bearer token provider
  • Method Details

    • getToken

      public @Nullable HttpClient.TokenResponse getToken()
      Get the token
      Returns:
      The token
    • setToken

      public void setToken(HttpClient.TokenResponse token)
      Set the token
      Parameters:
      token - The token
    • getAuthHeader

      public @Nullable String getAuthHeader(ContainerRef registry)
      Description copied from interface: AuthProvider
      Get the authentication header for this provider
      Specified by:
      getAuthHeader in interface AuthProvider
      Parameters:
      registry - The registry
      Returns:
      The authentication header or null if not applicable
    • getAuthScheme

      public AuthScheme getAuthScheme()
      Description copied from interface: AuthProvider
      Get the authentication scheme for this provider
      Specified by:
      getAuthScheme in interface AuthProvider
      Returns:
      The authentication scheme