@InternalApi public final class TokenEndpointClient extends Object
This class provides a method to request an OAuth token from a specified token endpoint URL
using the provided HTTP client and request parameters. It handles the HTTP request and parses the
JSON response into an OAuthResponse object.
| Modifier and Type | Method and Description |
|---|---|
static OAuthResponse |
requestToken(HttpClient httpClient,
String tokenEndpointUrl,
Map<String,String> params)
Requests an OAuth token from the specified token endpoint.
|
static Token |
retrieveToken(HttpClient hc,
String clientId,
String clientSecret,
String tokenUrl,
Map<String,String> params,
Map<String,String> headers,
AuthParameterPosition position)
Helper method implementing OAuth token refresh.
|
public static OAuthResponse requestToken(HttpClient httpClient, String tokenEndpointUrl, Map<String,String> params) throws DatabricksException
httpClient - The HttpClient to use for making the request.tokenEndpointUrl - The URL of the token endpoint.params - A map of parameters to include in the token request.OAuthResponse containing the token information.DatabricksException - if an error occurs during the token request or response parsing.IllegalArgumentException - if the token endpoint URL is empty.NullPointerException - if any of the parameters are null.public static Token retrieveToken(HttpClient hc, String clientId, String clientSecret, String tokenUrl, Map<String,String> params, Map<String,String> headers, AuthParameterPosition position)
hc - The HttpClient to use for making the request.clientId - The client ID to authenticate with.clientSecret - The client secret to authenticate with.tokenUrl - The authorization URL for fetching tokens.params - Additional request parameters.headers - Additional headers.position - The position of the authentication parameters in the request.DatabricksException - if the refresh fails.IllegalArgumentException - if the OAuth response contains an error.Copyright © 2026. All rights reserved.