ConfidentialClientApplication Constructors

Definition

Overloads

ConfidentialClientApplication(String, String, ClientCredential, TokenCache, TokenCache)

[V2 API] Constructor for a confidential client application requesting tokens with the default authority (Microsoft.Identity.Client.ClientApplicationBase.DefaultAuthority)

ConfidentialClientApplication(String, String, String, ClientCredential, TokenCache, TokenCache)

[V2 API] Constructor for a confidential client application requesting tokens with a specified authority

ConfidentialClientApplication(String, String, ClientCredential, TokenCache, TokenCache)

Warning

This API is now obsolete.

[V2 API] Constructor for a confidential client application requesting tokens with the default authority (Microsoft.Identity.Client.ClientApplicationBase.DefaultAuthority)

[System.Obsolete("Use ConfidentialClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes", true)]
public ConfidentialClientApplication (string clientId, string redirectUri, Microsoft.Identity.Client.ClientCredential clientCredential, Microsoft.Identity.Client.TokenCache userTokenCache, Microsoft.Identity.Client.TokenCache appTokenCache);
new Microsoft.Identity.Client.ConfidentialClientApplication : string * string * Microsoft.Identity.Client.ClientCredential * Microsoft.Identity.Client.TokenCache * Microsoft.Identity.Client.TokenCache -> Microsoft.Identity.Client.ConfidentialClientApplication

Parameters

clientId
String

Client ID (also known as App ID) of the application as registered in the application registration portal (https://aka.ms/msal-net-register-app)/. REQUIRED

redirectUri
String

URL where the STS will call back the application with the security token. REQUIRED

clientCredential
ClientCredential

Credential, previously shared with Azure AD during the application registration and proving the identity of the application. An instance of Microsoft.Identity.Client.ConfidentialClientApplication.ClientCredential can be created either from an application secret, or a certificate. REQUIRED.

userTokenCache
TokenCache

Token cache for saving user tokens. Can be set to null if the confidential client application only uses the Client Credentials grants (that is requests token in its own name and not in the name of users). Otherwise should be provided. REQUIRED

appTokenCache
TokenCache

Token cache for saving application (that is client token). Can be set to null except if the application uses the client credentials grants

Attributes

Remarks

See https://aka.ms/msal-net-client-applications for a description of confidential client applications (and public client applications) Client credential grants are overrides of AcquireTokenForClientAsync(IEnumerable<String>)

See also ConfidentialClientApplicationBuilder for the V3 API way of building a confidential client application with a builder pattern. It offers building the application from configuration options, and a more fluid way of providing parameters.

See also

ConfidentialClientApplication(String, String, String, ClientCredential, TokenCache, TokenCache)

Warning

This API is now obsolete.

[V2 API] Constructor for a confidential client application requesting tokens with a specified authority

[System.Obsolete("Use ConfidentialClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes", true)]
public ConfidentialClientApplication (string clientId, string authority, string redirectUri, Microsoft.Identity.Client.ClientCredential clientCredential, Microsoft.Identity.Client.TokenCache userTokenCache, Microsoft.Identity.Client.TokenCache appTokenCache);
new Microsoft.Identity.Client.ConfidentialClientApplication : string * string * string * Microsoft.Identity.Client.ClientCredential * Microsoft.Identity.Client.TokenCache * Microsoft.Identity.Client.TokenCache -> Microsoft.Identity.Client.ConfidentialClientApplication

Parameters

clientId
String

Client ID (also named Application ID) of the application as registered in the application registration portal (https://aka.ms/msal-net-register-app)/. REQUIRED

authority
String

Authority of the security token service (STS) from which MSAL.NET will acquire the tokens. Usual authorities are:

  • https://login.microsoftonline.com/tenant/, where tenant is the tenant ID of the Azure AD tenant or a domain associated with this Azure AD tenant, in order to sign-in users of a specific organization only
  • https://login.microsoftonline.com/common/ to sign-in users with any work and school accounts or Microsoft personal accounts
  • https://login.microsoftonline.com/organizations/ to sign-in users with any work and school accounts
  • https://login.microsoftonline.com/consumers/ to sign-in users with only personal Microsoft accounts(live)
Note that this setting needs to be consistent with what is declared in the application registration portal

redirectUri
String

URL where the STS will call back the application with the security token. REQUIRED

clientCredential
ClientCredential

Credential, previously shared with Azure AD during the application registration and proving the identity of the application. An instance of Microsoft.Identity.Client.ConfidentialClientApplication.ClientCredential can be created either from an application secret, or a certificate. REQUIRED.

userTokenCache
TokenCache

Token cache for saving user tokens. Can be set to null if the confidential client application only uses the Client Credentials grants (that is requests token in its own name and not in the name of users). Otherwise should be provided. REQUIRED

appTokenCache
TokenCache

Token cache for saving application (that is client token). Can be set to null except if the application uses the client credentials grants

Attributes

Remarks

See https://aka.ms/msal-net-client-applications for a description of confidential client applications (and public client applications) Client credential grants are overrides of AcquireTokenForClientAsync(IEnumerable<String>)

See also ConfidentialClientApplicationBuilder for the V3 API way of building a confidential client application with a builder pattern. It offers building the application from configuration options, and a more fluid way of providing parameters.

See also

Applies to