public class SessionCredentials extends RefreshableTokenSource implements CredentialsProvider, Serializable
SessionCredentials are OAuth credentials with a short-lived access token, used to make requests to an API, and a long-lived refresh token, which can be used to fetch new access tokens. Calling refresh() uses the refresh token to retrieve a new access token to authenticate to APIs.
RefreshableTokenSource.TokenStatetoken| Modifier and Type | Method and Description |
|---|---|
String |
authType() |
OAuthHeaderFactory |
configure(DatabricksConfig config) |
protected Token |
refresh()
Refresh the OAuth token.
|
getToken, getTokenAsync, getTokenBlocking, getTokenState, retrieveToken, withAsyncRefresh, withClockSupplier, withExpiryBufferpublic String authType()
authType in interface CredentialsProviderpublic OAuthHeaderFactory configure(DatabricksConfig config)
configure in interface CredentialsProviderprotected Token refresh()
RefreshableTokenSourceThis method may throw an exception if the token cannot be refreshed. The specific exception type depends on the implementation.
refresh in class RefreshableTokenSourceCopyright © 2025. All rights reserved.