public class DeviceCodeTokenProvider extends AccessTokenProvider
token
Constructor and Description |
---|
DeviceCodeTokenProvider(String appId)
Prompts user to log in and constructs a tokenProvider based on the refresh token obtained from the login.
|
DeviceCodeTokenProvider(String appId,
com.microsoft.azure.datalake.store.oauth2.DeviceCodeCallback callback)
Prompts user to log in and constructs a tokenProvider based on the refresh token obtained from the login.
|
Modifier and Type | Method and Description |
---|---|
String |
getRefreshToken() |
protected AzureADToken |
refreshToken()
the method to fetch the access token.
|
getToken
public DeviceCodeTokenProvider(String appId) throws IOException
appId
- the app ID whose name Azure AD will display on the login screenIOException
- in case of errorspublic DeviceCodeTokenProvider(String appId, com.microsoft.azure.datalake.store.oauth2.DeviceCodeCallback callback) throws IOException
appId
- the app ID whose name Azure AD will display on the login screen. Can be null.
If not provided, a default appId will be used.callback
- callback that can display the message to the user on how to login. Can be null.
If not provided, the default callback will be used which diplays the message on standard output.IOException
- in case of errorsprotected AzureADToken refreshToken() throws IOException
AccessTokenProvider
This method will be called initially, and then once when the token is about to expire.
refreshToken
in class AccessTokenProvider
AzureADToken
containing the access tokenIOException
- if there is an error fetching the tokenpublic String getRefreshToken()
Copyright © 2019 Microsoft Corporation. All rights reserved.