Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OnBehalfOfCredential

Package version

Enables authentication to Azure Active Directory using the On Behalf Of flow.

Hierarchy

  • OnBehalfOfCredential

Implements

  • any
  • any

Index

Constructors

Methods

Constructors

constructor

  • 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");

    Returns OnBehalfOfCredential

Methods

getToken

  • getToken(): Promise<AccessToken | null>

Generated using TypeDoc