@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.
|
| Modifier and Type | Method and Description |
|---|---|
static AzureADToken |
getTokenFromMsi(String tenantGuid,
String clientId,
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 clientId,
String refreshToken)
Gets Azure Active Directory token using refresh token.
|
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 tenantGuid, String clientId, boolean bypassCache) throws IOException
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 clientId, String refreshToken) throws IOException
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–2020 Apache Software Foundation. All rights reserved.