ConfidentialClientApplication Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ConfidentialClientApplication(String, String, ClientCredential, TokenCache, TokenCache) |
Obsolete.
[V2 API] Constructor for a confidential client application requesting tokens with the default authority (Microsoft.Identity.Client.ApplicationBase.DefaultAuthority) |
ConfidentialClientApplication(String, String, String, ClientCredential, TokenCache, TokenCache) |
Obsolete.
[V2 API] Constructor for a confidential client application requesting tokens with a specified authority |
ConfidentialClientApplication(String, String, ClientCredential, TokenCache, TokenCache)
Caution
Use ConfidentialClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes.
[V2 API] Constructor for a confidential client application requesting tokens with the default authority (Microsoft.Identity.Client.ApplicationBase.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);
[<System.Obsolete("Use ConfidentialClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
new Microsoft.Identity.Client.ConfidentialClientApplication : string * string * Microsoft.Identity.Client.ClientCredential * Microsoft.Identity.Client.TokenCache * Microsoft.Identity.Client.TokenCache -> Microsoft.Identity.Client.ConfidentialClientApplication
Public Sub New (clientId As String, redirectUri As String, clientCredential As ClientCredential, userTokenCache As TokenCache, appTokenCache As TokenCache)
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 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
ConfidentialClientApplication(String, String, String, ClientCredential, TokenCache, TokenCache)
Caution
Use ConfidentialClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes.
[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);
[<System.Obsolete("Use ConfidentialClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
new Microsoft.Identity.Client.ConfidentialClientApplication : string * string * string * Microsoft.Identity.Client.ClientCredential * Microsoft.Identity.Client.TokenCache * Microsoft.Identity.Client.TokenCache -> Microsoft.Identity.Client.ConfidentialClientApplication
Public Sub New (clientId As String, authority As String, redirectUri As String, clientCredential As ClientCredential, userTokenCache As TokenCache, appTokenCache As TokenCache)
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/
, wheretenant
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 onlyhttps://login.microsoftonline.com/common/
to sign-in users with any work and school accounts or Microsoft personal accountshttps://login.microsoftonline.com/organizations/
to sign-in users with any work and school accountshttps://login.microsoftonline.com/consumers/
to sign-in users with only personal Microsoft accounts(live)
- 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 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.