PublicClientApplication constructor

PublicClientApplication(
  1. Configuration configuration
)

Creates a new PublicClientApplication.

Important attributes in the configuration object for auth are:

In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.

  • It is 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.

Implementation

factory PublicClientApplication(Configuration configuration) {
  try {
    return PublicClientApplication._fromJsObject(
        interop.PublicClientApplication(configuration._jsObject));
  } on interop.JsError catch (ex) {
    throw convertJsError(ex);
  }
}