public abstract class AccessTokenProvider extends Object
In other words, this is is a token cache that fetches tokens when requested, if the cached token has expired.
Modifier and Type | Field and Description |
---|---|
protected AzureADToken |
token |
Constructor and Description |
---|
AccessTokenProvider() |
Modifier and Type | Method and Description |
---|---|
AzureADToken |
getToken()
returns the
AzureADToken cached (or retrieved) by this instance. |
protected abstract AzureADToken |
refreshToken()
the method to fetch the access token.
|
protected AzureADToken token
public AzureADToken getToken() throws IOException
AzureADToken
cached (or retrieved) by this instance.AzureADToken
containing the access tokenIOException
- if there is an error fetching the tokenprotected abstract AzureADToken refreshToken() throws IOException
This method will be called initially, and then once when the token is about to expire.
AzureADToken
containing the access tokenIOException
- if there is an error fetching the tokenCopyright © 2019 Microsoft Corporation. All rights reserved.