Package land.oras.auth
Class BearerTokenProvider
java.lang.Object
land.oras.auth.BearerTokenProvider
- All Implemented Interfaces:
AuthProvider
A provider for bearer token authentication
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable String
getAuthHeader
(ContainerRef registry) Get the authentication header for this providerGet the authentication scheme for this provider@Nullable HttpClient.TokenResponse
getToken()
Get the tokenvoid
setToken
(HttpClient.TokenResponse token) Set the token
-
Constructor Details
-
BearerTokenProvider
public BearerTokenProvider()Create a new bearer token provider
-
-
Method Details
-
getToken
Get the token- Returns:
- The token
-
setToken
Set the token- Parameters:
token
- The token
-
getAuthHeader
Description copied from interface:AuthProvider
Get the authentication header for this provider- Specified by:
getAuthHeader
in interfaceAuthProvider
- Parameters:
registry
- The registry- Returns:
- The authentication header or null if not applicable
-
getAuthScheme
Description copied from interface:AuthProvider
Get the authentication scheme for this provider- Specified by:
getAuthScheme
in interfaceAuthProvider
- Returns:
- The authentication scheme
-