Creates an instance of the OnBehalfOfCredential with the details needed to authenticate against Azure Active Directory with a client secret or a path to a PEM certificate, and an user assertion. Creates an instance of the OnBehalfOfCredential with the details needed to authenticate against Azure Active Directory with a client secret or a path to a PEM certificate, and an user assertion.
Example using the KeyClient
from @azure/keyvault-keys:
const tokenCredential = new OnBehalfOfCredential({
tenantId,
clientId,
clientSecret, // or `certificatePath: "/path/to/certificate.pem"
userAssertionToken: "access-token"
});
const client = new KeyClient("vault-url", tokenCredential);
await client.getKey("key-name");
Example using the KeyClient
from @azure/keyvault-keys:
const tokenCredential = new OnBehalfOfCredential({
tenantId,
clientId,
clientSecret, // or `certificatePath: "/path/to/certificate.pem"
userAssertionToken: "access-token"
});
const client = new KeyClient("vault-url", tokenCredential);
await client.getKey("key-name");
Authenticates with Azure Active Directory and returns an access token if successful. If authentication fails, a CredentialUnavailableError will be thrown with the details of the failure.
Generated using TypeDoc
Enables authentication to Azure Active Directory using the On Behalf Of flow.