public abstract class AzureTokenCredentials extends TokenCredentials
Constructor and Description |
---|
AzureTokenCredentials(AzureEnvironment environment,
String domain)
Initializes a new instance of the AzureTokenCredentials.
|
Modifier and Type | Method and Description |
---|---|
void |
applyCredentialsFilter(okhttp3.OkHttpClient.Builder clientBuilder)
Apply the credentials to the HTTP client builder.
|
String |
defaultSubscriptionId() |
String |
domain()
Override this method to provide the domain or tenant ID the token is valid in.
|
AzureEnvironment |
environment() |
protected String |
getToken(okhttp3.Request request)
Get the secure token.
|
abstract String |
getToken(String resource)
Override this method to provide the mechanism to get a token.
|
Proxy |
proxy() |
AzureTokenCredentials |
withDefaultSubscriptionId(String subscriptionId)
Set default subscription ID.
|
AzureTokenCredentials |
withProxy(Proxy proxy)
Set the proxy used for accessing Active Directory.
|
getScheme
public AzureTokenCredentials(AzureEnvironment environment, String domain)
environment
- the Azure environment to usedomain
- the tenant or domain the credential is authorized toprotected final String getToken(okhttp3.Request request) throws IOException
TokenCredentials
getToken
in class TokenCredentials
request
- the context of the HTTP requestIOException
- exception thrown from token acquisition operations.public abstract String getToken(String resource) throws IOException
resource
- the resource the access token is forIOException
- exceptions from IOpublic String domain()
public AzureEnvironment environment()
public String defaultSubscriptionId()
public AzureTokenCredentials withDefaultSubscriptionId(String subscriptionId)
subscriptionId
- the default subscription ID.public Proxy proxy()
public AzureTokenCredentials withProxy(Proxy proxy)
proxy
- the proxy to usepublic void applyCredentialsFilter(okhttp3.OkHttpClient.Builder clientBuilder)
ServiceClientCredentials
applyCredentialsFilter
in interface ServiceClientCredentials
applyCredentialsFilter
in class TokenCredentials
clientBuilder
- the builder for building up an OkHttpClient
Copyright © 2019. All rights reserved.