PublicClientApplication 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
PublicClientApplication(String) |
Obsolete.
Constructor of the application. It will use |
PublicClientApplication(String, String) |
Obsolete.
Constructor of the application. |
PublicClientApplication(String, String, TokenCache) |
Obsolete.
Constructor to create application instance. This constructor is only available for Desktop and NetCore apps |
PublicClientApplication(String)
Caution
Use PublicClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes.
Constructor of the application. It will use https://login.microsoftonline.com/common
as the default authority.
[System.Obsolete("Use PublicClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public PublicClientApplication (string clientId);
[<System.Obsolete("Use PublicClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
new Microsoft.Identity.Client.PublicClientApplication : string -> Microsoft.Identity.Client.PublicClientApplication
Public Sub New (clientId As String)
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
- Attributes
Applies to
PublicClientApplication(String, String)
Caution
Use PublicClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes.
Constructor of the application.
[System.Obsolete("Use PublicClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public PublicClientApplication (string clientId, string authority);
[<System.Obsolete("Use PublicClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
new Microsoft.Identity.Client.PublicClientApplication : string * string -> Microsoft.Identity.Client.PublicClientApplication
Public Sub New (clientId As String, authority As String)
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 user of a specific organization onlyhttps://login.microsoftonline.com/common/
to signing users with any work and school accounts or Microsoft personal accounthttps://login.microsoftonline.com/organizations/
to signing users with any work and school accountshttps://login.microsoftonline.com/consumers/
to signing users with only personal Microsoft account (live)
- Attributes
Applies to
PublicClientApplication(String, String, TokenCache)
Caution
Use PublicClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes.
Constructor to create application instance. This constructor is only available for Desktop and NetCore apps
[System.Obsolete("Use PublicClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)]
public PublicClientApplication (string clientId, string authority, Microsoft.Identity.Client.TokenCache userTokenCache);
[<System.Obsolete("Use PublicClientApplicationBuilder instead. See https://aka.ms/msal-net-3-breaking-changes. ", true)>]
new Microsoft.Identity.Client.PublicClientApplication : string * string * Microsoft.Identity.Client.TokenCache -> Microsoft.Identity.Client.PublicClientApplication
Public Sub New (clientId As String, authority As String, userTokenCache As TokenCache)
Parameters
- clientId
- String
Client id of the application
- authority
- String
Default authority to be used for the application
- userTokenCache
- TokenCache
Instance of TokenCache.
- Attributes