Azure / Azure/azure-libraries-for-java

Not able to login with ApplicationTokenCredentials.

Open
#686 2 comments 0 reactions 0 assignees View on GitHub
Authentication customer-reported needs-more-info
Dominant language
Java
Stars
97
Forks
102
PR merge metrics
No merged PRs in 30d

Description

**As per document:**

Using ApplicationTokenCredentials
Similarly to the file-based approach, this method requires a service principal registration, but instead of storing the credentials in a local file, the required inputs can be supplied directly via an instance of the ApplicationTokenCredentials class:

ApplicationTokenCredentials credentials = new ApplicationTokenCredentials(
client, tenant, key, AzureEnvironment.AZURE);
Azure azure = Azure.authenticate(credentials).withSubscription(subscriptionId);
or

ApplicationTokenCredentials credentials = new ApplicationTokenCredentials(
client, tenant, pfxCertificatePath, password, AzureEnvironment.AZURE);
Azure azure = Azure.authenticate(credentials).withSubscription(subscriptionId);
where client, tenant, subscriptionId, and key or pfxCertificatePath and password are strings with the required pieces of information about your service principal and subscription. The last parameter, AzureEnvironment.AZURE represents the Azure worldwide public cloud. You can use a different value out of the currently supported alternatives in the AzureEnvironment enum.

##############################################
But as mentioned above implementation of ApplicationTokenCredentials in java is:
ApplicationTokenCredentials(string clientID, sring tenantID, byte [] certificate, String certificatePassword, environment);

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.