@Beta public class MSICredentials extends AzureTokenCredentials
| Constructor and Description |
|---|
MSICredentials()
Initializes a new instance of the MSICredentials.
|
MSICredentials(AzureEnvironment environment)
Initializes a new instance of the MSICredentials.
|
MSICredentials(AzureEnvironment environment,
int msiPort)
Deprecated.
use
MSICredentials() or MSICredentials(AzureEnvironment) instead. |
| Modifier and Type | Method and Description |
|---|---|
String |
getToken(String resource) |
MSICredentials |
withClientId(String clientId)
Specifies the application id (client id) associated with a user assigned managed service identity
resource that should be used to retrieve the access token.
|
MSICredentials |
withIdentityId(String identityId)
Specifies the ARM resource id of the user assigned managed service identity resource that
should be used to retrieve the access token.
|
MSICredentials |
withObjectId(String objectId)
Specifies the object id associated with a user assigned managed service identity
resource that should be used to retrieve the access token.
|
applyCredentialsFilter, defaultSubscriptionId, domain, environment, getToken, proxy, sslSocketFactory, withDefaultSubscriptionId, withProxy, withSslSocketFactorypublic MSICredentials()
public MSICredentials(AzureEnvironment environment)
environment - the Azure environment to use@Deprecated public MSICredentials(AzureEnvironment environment, int msiPort)
MSICredentials() or MSICredentials(AzureEnvironment) instead.environment - the Azure environment to usemsiPort - the local port to retrieve token from@Beta public MSICredentials withObjectId(String objectId)
objectId - Object ID of the identity to use when authenticating to Azure AD.@Beta public MSICredentials withClientId(String clientId)
clientId - application id (client id) of the identity to use when authenticating to Azure AD.@Beta public MSICredentials withIdentityId(String identityId)
identityId - the ARM resource id of the user assigned identity resourcepublic String getToken(String resource) throws IOException
getToken in class AzureTokenCredentialsIOException/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/