@InterfaceAudience.Private @InterfaceStability.Evolving public final class AzureADAuthenticator extends Object
Modifier and Type | Class and 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 and Description |
---|---|
static AzureADToken |
getTokenFromMsi(String authEndpoint,
String tenantGuid,
String clientId,
String authority,
boolean bypassCache)
Gets AAD token from the local virtual machine's VM extension.
|
static AzureADToken |
getTokenUsingClientCreds(String authEndpoint,
String clientId,
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 |
getTokenUsingRefreshToken(String authEndpoint,
String clientId,
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(String authEndpoint, String clientId, String clientSecret) throws 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 credsIOException
- throws IOException if there is a failure in connecting to Azure ADpublic static AzureADToken getTokenFromMsi(String authEndpoint, String tenantGuid, String clientId, String authority, boolean bypassCache) throws 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 credsIOException
- throws IOException if there is a failure in obtaining the tokenpublic static AzureADToken getTokenUsingRefreshToken(String authEndpoint, String clientId, String refreshToken) throws 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 tokenIOException
- throws IOException if there is a failure in connecting to Azure ADCopyright © 2008–2021 Apache Software Foundation. All rights reserved.