@Beta public final class AzureCliCredentials extends AzureTokenCredentials
Modifier and Type | Method and Description |
---|---|
String |
clientId() |
static AzureCliCredentials |
create()
Creates an instance of AzureCliCredentials with the default Azure CLI configuration.
|
static AzureCliCredentials |
create(File azureProfile,
File accessTokens)
Creates an instance of AzureCliCredentials with custom locations of the token files.
|
String |
domain()
Override this method to provide the domain or tenant ID the token is valid in.
|
AzureEnvironment |
environment() |
String |
getToken(String resource)
Override this method to provide the mechanism to get a token.
|
applyCredentialsFilter, defaultSubscriptionId, getToken, proxy, withDefaultSubscriptionId, withProxy
getScheme
public static AzureCliCredentials create() throws IOException
IOException
- if the Azure CLI token files are not accessiblepublic static AzureCliCredentials create(File azureProfile, File accessTokens) throws IOException
azureProfile
- the azureProfile.json file created by Azure CLIaccessTokens
- the accessTokens.json file created by Azure CLIIOException
- if the Azure CLI token files are not accessiblepublic String clientId()
public String domain()
AzureTokenCredentials
domain
in class AzureTokenCredentials
public AzureEnvironment environment()
environment
in class AzureTokenCredentials
public String getToken(String resource) throws IOException
AzureTokenCredentials
getToken
in class AzureTokenCredentials
resource
- the resource the access token is forIOException
- exceptions from IOCopyright © 2019. All rights reserved.