@Private
@Evolving
public final class AzureADAuthenticator
extends java.lang.Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
AzureADAuthenticator.HttpException |
This exception class contains the http error code,
requestId and error message, it is thrown when AzureADAuthenticator
failed to get the Azure Active Directory token.
|
static class |
AzureADAuthenticator.UnexpectedResponseException |
An unexpected HTTP response was raised, such as text coming back
from what should be an OAuth endpoint.
|
| Modifier and Type | Method | Description |
|---|---|---|
static AzureADToken |
getTokenFromMsi(java.lang.String authEndpoint,
java.lang.String tenantGuid,
java.lang.String clientId,
java.lang.String authority,
boolean bypassCache) |
Gets AAD token from the local virtual machine's VM extension.
|
static AzureADToken |
getTokenUsingClientCreds(java.lang.String authEndpoint,
java.lang.String clientId,
java.lang.String clientSecret) |
gets Azure Active Directory token using the user ID and password of
a service principal (that is, Web App in Azure Active Directory).
|
static AzureADToken |
getTokenUsingJWTAssertion(java.lang.String authEndpoint,
java.lang.String clientId,
java.lang.String clientAssertion) |
Gets Azure Active Directory token using the user ID and a JWT assertion
generated by a federated authentication process.
|
static AzureADToken |
getTokenUsingRefreshToken(java.lang.String authEndpoint,
java.lang.String clientId,
java.lang.String refreshToken) |
Gets Azure Active Directory token using refresh token.
|
static void |
init(AbfsConfiguration abfsConfiguration) |
public static void init(AbfsConfiguration abfsConfiguration)
public static AzureADToken getTokenUsingClientCreds(java.lang.String authEndpoint, java.lang.String clientId, java.lang.String clientSecret) throws java.io.IOException
authEndpoint - the OAuth 2.0 token endpoint associated
with the user's directory (obtain from
Active Directory configuration)clientId - the client ID (GUID) of the client web app
btained from Azure Active Directory configurationclientSecret - the secret key of the client web appAzureADToken obtained using the credsjava.io.IOException - throws IOException if there is a failure in connecting to Azure ADpublic static AzureADToken getTokenUsingJWTAssertion(java.lang.String authEndpoint, java.lang.String clientId, java.lang.String clientAssertion) throws java.io.IOException
authEndpoint - the OAuth 2.0 token endpoint associated
with the user's directory (obtain from
Active Directory configuration)clientId - the client ID (GUID) of the client web app
obtained from Azure Active Directory configurationclientAssertion - the JWT assertion tokenAzureADToken obtained using the credsjava.io.IOException - throws IOException if there is a failure in connecting to Azure ADpublic static AzureADToken getTokenFromMsi(java.lang.String authEndpoint, java.lang.String tenantGuid, java.lang.String clientId, java.lang.String authority, boolean bypassCache) throws java.io.IOException
authEndpoint - the OAuth 2.0 token endpoint associated
with the user's directory (obtain from
Active Directory configuration)tenantGuid - (optional) The guid of the AAD tenant. Can be null.clientId - (optional) The clientId guid of the MSI service
principal to use. Can be null.bypassCache - boolean specifying whether a cached token is acceptable or a fresh token
request should me made to AADAzureADToken obtained using the credsjava.io.IOException - throws IOException if there is a failure in obtaining the tokenpublic static AzureADToken getTokenUsingRefreshToken(java.lang.String authEndpoint, java.lang.String clientId, java.lang.String refreshToken) throws java.io.IOException
authEndpoint - the OAuth 2.0 token endpoint associated
with the user's directory (obtain from
Active Directory configuration)clientId - the client ID (GUID) of the client web app obtained from Azure Active Directory configurationrefreshToken - the refresh tokenAzureADToken obtained using the refresh tokenjava.io.IOException - throws IOException if there is a failure in connecting to Azure ADCopyright © 2008–2025 Apache Software Foundation. All rights reserved.