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) |
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) |
abstract String |
getToken(String resource)
Override this method to provide the mechanism to get a token.
|
Proxy |
proxy() |
SSLSocketFactory |
sslSocketFactory() |
AzureTokenCredentials |
withDefaultSubscriptionId(String subscriptionId)
Set default subscription ID.
|
AzureTokenCredentials |
withProxy(Proxy proxy) |
AzureTokenCredentials |
withSslSocketFactory(SSLSocketFactory sslSocketFactory) |
getSchemepublic 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
getToken in class TokenCredentialsIOExceptionpublic 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 SSLSocketFactory sslSocketFactory()
public AzureTokenCredentials withProxy(Proxy proxy)
proxy - the proxy being used for accessing Active Directorypublic AzureTokenCredentials withSslSocketFactory(SSLSocketFactory sslSocketFactory)
sslSocketFactory - the ssl socket factorypublic void applyCredentialsFilter(okhttp3.OkHttpClient.Builder clientBuilder)
applyCredentialsFilter in interface ServiceClientCredentialsapplyCredentialsFilter in class TokenCredentials/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/