Esh
Esh

Reputation: 856

Authenticating Azure Key Vault using Java

In my previous question i tried to access the Azure Key Vault using clientID and client-secret and get the vault information. Now am trying to access the key vault using clientID and certificate based authentication. I have googled and found this. But unable to proceed further, as i could not understand how to proceed further.

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

Could someone provide insights what should be the value for tenant and subscriptioID. Also, do i have to provide my certification path in the pfxcertification Please help me in understanding the above lines of code.

Thanks

Upvotes: 2

Views: 585

Answers (1)

Shui shengbao
Shui shengbao

Reputation: 19206

This link will be helpful.

Could someone provide insights what should be the value for tenant and subscriptioID.

If my understanding is right, tenant value is your domain name or tenant id. The subscription id is the subscription that you want to manage key vault.

You could create a auth file like below.

subscription=########-####-####-####-############
client=########-####-####-####-############
tenant=########-####-####-####-############
certificate=<path to certificate file>
certificatePassword=XXXXXXXXXXXXXXXX
managementURI=https\://management.core.windows.net/
baseURL=https\://management.azure.com/
authURL=https\://login.windows.net/
graphURL=https\://graph.windows.net/

Upvotes: 1

Related Questions