Package org.apache.iceberg.rest.auth
Class OAuth2Util.AuthSession
java.lang.Object
org.apache.iceberg.rest.auth.OAuth2Util.AuthSession
- Enclosing class:
OAuth2Util
Class to handle authorization headers and token refresh.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconfig()
static OAuth2Util.AuthSession
empty()
A newOAuth2Util.AuthSession
with empty headers.static OAuth2Util.AuthSession
fromAccessToken
(RESTClient client, ScheduledExecutorService executor, String token, Long defaultExpiresAtMillis, OAuth2Util.AuthSession parent) static OAuth2Util.AuthSession
fromCredential
(RESTClient client, ScheduledExecutorService executor, String credential, OAuth2Util.AuthSession parent) static OAuth2Util.AuthSession
fromTokenExchange
(RESTClient client, ScheduledExecutorService executor, String token, String tokenType, OAuth2Util.AuthSession parent) static OAuth2Util.AuthSession
fromTokenResponse
(RESTClient client, ScheduledExecutorService executor, OAuthTokenResponse response, long startTimeMillis, OAuth2Util.AuthSession parent) headers()
refresh
(RESTClient client) Attempt to refresh the session token using the token exchange flow.scope()
void
token()
-
Constructor Details
-
AuthSession
-
-
Method Details
-
headers
-
token
-
tokenType
-
expiresAtMillis
-
scope
-
stopRefreshing
public void stopRefreshing() -
credential
-
oauth2ServerUri
-
optionalOAuthParams
-
config
-
empty
A newOAuth2Util.AuthSession
with empty headers.- Returns:
- A new
OAuth2Util.AuthSession
with empty headers.
-
refresh
Attempt to refresh the session token using the token exchange flow.- Parameters:
client
- a RESTClient- Returns:
- interval to wait before calling refresh again, or null if no refresh is needed
-
fromAccessToken
public static OAuth2Util.AuthSession fromAccessToken(RESTClient client, ScheduledExecutorService executor, String token, Long defaultExpiresAtMillis, OAuth2Util.AuthSession parent) -
fromCredential
public static OAuth2Util.AuthSession fromCredential(RESTClient client, ScheduledExecutorService executor, String credential, OAuth2Util.AuthSession parent) -
fromTokenResponse
public static OAuth2Util.AuthSession fromTokenResponse(RESTClient client, ScheduledExecutorService executor, OAuthTokenResponse response, long startTimeMillis, OAuth2Util.AuthSession parent) -
fromTokenExchange
public static OAuth2Util.AuthSession fromTokenExchange(RESTClient client, ScheduledExecutorService executor, String token, String tokenType, OAuth2Util.AuthSession parent)
-