Package org.apache.hadoop.fs.adl.oauth2
Class AzureADTokenProvider
java.lang.Object
org.apache.hadoop.fs.adl.oauth2.AzureADTokenProvider
Provide an Azure Active Directory supported
OAuth2 access token to be used to authenticate REST calls against Azure data
lake file system
AdlFileSystem.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StringObtain the access token that should be added to https connection's header.abstract DateObtain expiry time of the token.abstract voidinitialize(Configuration configuration) Initialize with supported configuration.
-
Constructor Details
-
AzureADTokenProvider
public AzureADTokenProvider()
-
-
Method Details
-
initialize
Initialize with supported configuration. This method is invoked when the(URI, Configuration)method is invoked.- Parameters:
configuration- Configuration object- Throws:
IOException- if instance can not be configured.
-
getAccessToken
Obtain the access token that should be added to https connection's header. Will be called depending upongetExpiryTime()expiry time is set, so implementations should be performant. Implementations are responsible for any refreshing of the token.- Returns:
- String containing the access token
- Throws:
IOException- if there is an error fetching the token
-
getExpiryTime
Obtain expiry time of the token. If implementation is performant enough to maintain expiry and expectgetAccessToken()call for every connection then safe to return current or past time. However recommended to use the token expiry time received from Azure Active Directory.- Returns:
- Date to expire access token retrieved from AAD.
-