Udostępnij za pośrednictwem


ClientApplicationBase Class

Definition

Abstract class containing common API methods and properties. Both PublicClientApplication and ConfidentialClientApplication extend this class. For details see https://aka.ms/msal-net-client-applications

public abstract class ClientApplicationBase : Microsoft.Identity.Client.ApplicationBase, Microsoft.Identity.Client.IClientApplicationBase
type ClientApplicationBase = class
    inherit ApplicationBase
    interface IClientApplicationBase
    interface IApplicationBase
Public MustInherit Class ClientApplicationBase
Inherits ApplicationBase
Implements IClientApplicationBase
Inheritance
ClientApplicationBase
Derived
Implements

Properties

AppConfig

Details on the configuration of the ClientApplication for debugging purposes.

Authority

Gets the URL of the authority, or security token service (STS) from which MSAL.NET will acquire security tokens The return value of this property is either the value provided by the developer in the constructor of the application, or otherwise the value of the Microsoft.Identity.Client.ApplicationBase.DefaultAuthority static member (that is https://login.microsoftonline.com/common/)

ClientId
Obsolete.

Gets the Client ID (also known as Application ID) of the application as registered in the application registration portal (https://aka.ms/msal-net-register-app) and as passed in the constructor of the application

Component
Obsolete.

Identifier of the component (libraries/SDK) consuming MSAL.NET. This will allow for disambiguation between MSAL usage by the app vs MSAL usage by component libraries.

RedirectUri
Obsolete.

The redirect URI (also known as Reply URI or Reply URL), is the URI at which Azure AD will contact back the application with the tokens. This redirect URI needs to be registered in the app registration (https://aka.ms/msal-net-register-app). In MSAL.NET, PublicClientApplication define the following default RedirectUri values:

  • https://login.microsoftonline.com/common/oauth2/nativeclient for desktop (.NET Framework and .NET Core) applications
  • msal{ClientId} for Xamarin iOS and Xamarin Android (as this will be used by the system web browser by default on these platforms to call back the application)
These default URIs could change in the future. In Microsoft.Identity.Client.ConfidentialClientApplication, this can be the URL of the web application / web API.
SliceParameters
Obsolete.

Sets or Gets a custom query parameters that may be sent to the STS for dogfood testing or debugging. This is a string of segments of the form key=value separated by an ampersand character. Unless requested otherwise, this parameter should not be set by application developers as it may have adverse effect on the application.

Users
Obsolete.

In MSAL 1.x returned an enumeration of IUser. From MSAL 2.x, use GetAccountsAsync() instead. See https://aka.ms/msal-net-2-released for more details.

UserTokenCache

User token cache. It holds access tokens, id tokens and refresh tokens for accounts. It's used and updated silently if needed when calling AcquireTokenSilent(IEnumerable<String>, IAccount) or one of the overrides of AcquireTokenSilent(IEnumerable<String>, IAccount). It is updated by each AcquireTokenXXX method, with the exception of AcquireTokenForClient which only uses the application cache (see IConfidentialClientApplication).

ValidateAuthority
Obsolete.

Gets/sets a boolean value telling the application if the authority needs to be verified against a list of known authorities. The default value is true. It should currently be set to false for Azure AD B2C authorities as those are customer specific (a list of known B2C authorities cannot be maintained by MSAL.NET). This property can be set just after the construction of the application and before an operation acquiring a token or interacting with the STS.

Methods

AcquireTokenSilent(IEnumerable<String>, IAccount)

[V3 API] Attempts to acquire an access token for the account from the user token cache. See https://aka.ms/msal-net-acquiretokensilent for more details

AcquireTokenSilent(IEnumerable<String>, String)

[V3 API] Attempts to acquire an access token for the IAccount having the Username match the given loginHint, from the user token cache. See https://aka.ms/msal-net-acquiretokensilent for more details

AcquireTokenSilentAsync(IEnumerable<String>, IAccount, String, Boolean)
Obsolete.

[V2 API] Attempts to acquire an access token for the account from the user token cache, with advanced parameters controlling network call.

AcquireTokenSilentAsync(IEnumerable<String>, IAccount)
Obsolete.

[V2 API] Attempts to acquire an access token for the account from the user token cache.

GetAccountAsync(String, CancellationToken)

Get the IAccount by its identifier among the accounts available in the token cache.

GetAccountAsync(String)

Get the IAccount by its identifier among the accounts available in the token cache.

GetAccountsAsync()

Returns all the available accounts in the user token cache for the application.

GetAccountsAsync(CancellationToken)

Returns all the available accounts in the user token cache for the application.

GetAccountsAsync(String, CancellationToken)

Get the IAccount collection by its identifier among the accounts available in the token cache, based on the user flow. This is for Azure AD B2C scenarios.

GetAccountsAsync(String)

Get the IAccount collection by its identifier among the accounts available in the token cache, based on the user flow. This is for Azure AD B2C scenarios.

GetUser(String)
Obsolete.

In MSAL 1.x, return a user from its identifier. From MSAL 2.x, use GetAccountsAsync() instead. See https://aka.ms/msal-net-2-released for more details.

Remove(IUser)
Obsolete.

In MSAL 1.x removed a user from the cache. From MSAL 2.x, use RemoveAsync(IAccount) instead. See https://aka.ms/msal-net-2-released for more details.

RemoveAsync(IAccount, CancellationToken)

Removes all tokens in the cache for the specified account.

RemoveAsync(IAccount)

Removes all tokens in the cache for the specified account.

Applies to