@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)
Initializes a new instance of the MSICredentials.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getToken(String resource)
Override this method to provide the mechanism to get a token.
|
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, withDefaultSubscriptionId, withProxygetSchemepublic MSICredentials()
public MSICredentials(AzureEnvironment environment)
environment - the Azure environment to usepublic MSICredentials(AzureEnvironment environment, int msiPort)
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
AzureTokenCredentialsgetToken in class AzureTokenCredentialsresource - the resource the access token is forIOException - exceptions from IOCopyright © 2019. All rights reserved.