Class ConfidentialClientApplication

This class is to be used to acquire tokens for confidential client applications (webApp, webAPI). Confidential client applications will configure application secrets, client certificates/assertions as applicable

Hierarchy

Implements

Constructors

  • Constructor for the ConfidentialClientApplication

    Required attributes in the Configuration object are:

    • clientID: the application ID of your application. You can obtain one by registering your application with our application registration portal
    • authority: the authority URL for your application.
    • client credential: Must set either client secret, certificate, or assertion for confidential clients. You can obtain a client secret from the application registration portal.

    In Azure AD, authority is a URL indicating of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}. If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com). If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations. If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common. To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.

    In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/ Full B2C functionality will be available in this library in future versions.

    Parameters

    Returns ConfidentialClientApplication

Methods

  • Creates the URL of the authorization request, letting the user input credentials and consent to the application. The URL targets the /authorize endpoint of the authority configured in the application object.

    Once the user inputs their credentials and consents, the authority will send a response to the redirect URI sent in the request and should contain an authorization code, which can then be used to acquire tokens via acquireTokenByCode(AuthorizationCodeRequest).

    Parameters

    Returns Promise<string>

Generated using TypeDoc