PublicClientApplication PublicClientApplication PublicClientApplication Class

Definition

Class to be used for native applications (Desktop/UWP/iOS/Android).

public sealed class PublicClientApplication : Microsoft.Identity.Client.ClientApplicationBase, Microsoft.Identity.Client.IPublicClientApplication
type PublicClientApplication = class
    inherit ClientApplicationBase
    interface IPublicClientApplication
    interface IClientApplicationBase
Public NotInheritable Class PublicClientApplication
Inherits ClientApplicationBase
Implements IPublicClientApplication
Inheritance
PublicClientApplicationPublicClientApplicationPublicClientApplication
Implements

Constructors

PublicClientApplication(String) PublicClientApplication(String) PublicClientApplication(String)

Consutructor of the application. It will use https://login.microsoftonline.com/common as the default authority.

PublicClientApplication(String, String) PublicClientApplication(String, String) PublicClientApplication(String, String)

Consutructor of the application.

PublicClientApplication(String, String, TokenCache) PublicClientApplication(String, String, TokenCache) PublicClientApplication(String, String, TokenCache)

Constructor to create application instance. This constructor is only available for Dekstop and NetCore apps

Methods

AcquireTokenAsync(IEnumerable<String>) AcquireTokenAsync(IEnumerable<String>) AcquireTokenAsync(IEnumerable<String>)

Interactive request to acquire token.

AcquireTokenAsync(IEnumerable<String>, IUser) AcquireTokenAsync(IEnumerable<String>, IUser) AcquireTokenAsync(IEnumerable<String>, IUser)

Interactive request to acquire token.

AcquireTokenAsync(IEnumerable<String>, IUser, UIBehavior, String) AcquireTokenAsync(IEnumerable<String>, IUser, UIBehavior, String) AcquireTokenAsync(IEnumerable<String>, IUser, UIBehavior, String)

Interactive request to acquire token.

AcquireTokenAsync(IEnumerable<String>, IUser, UIBehavior, String, IEnumerable<String>, String) AcquireTokenAsync(IEnumerable<String>, IUser, UIBehavior, String, IEnumerable<String>, String) AcquireTokenAsync(IEnumerable<String>, IUser, UIBehavior, String, IEnumerable<String>, String)

Interactive request to acquire token.

AcquireTokenAsync(IEnumerable<String>, IUser, UIBehavior, String, IEnumerable<String>, String, UIParent) AcquireTokenAsync(IEnumerable<String>, IUser, UIBehavior, String, IEnumerable<String>, String, UIParent) AcquireTokenAsync(IEnumerable<String>, IUser, UIBehavior, String, IEnumerable<String>, String, UIParent)

Interactive request to acquire token.

AcquireTokenAsync(IEnumerable<String>, IUser, UIBehavior, String, UIParent) AcquireTokenAsync(IEnumerable<String>, IUser, UIBehavior, String, UIParent) AcquireTokenAsync(IEnumerable<String>, IUser, UIBehavior, String, UIParent)

Interactive request to acquire token.

AcquireTokenAsync(IEnumerable<String>, IUser, UIParent) AcquireTokenAsync(IEnumerable<String>, IUser, UIParent) AcquireTokenAsync(IEnumerable<String>, IUser, UIParent)

Interactive request to acquire token.

AcquireTokenAsync(IEnumerable<String>, String) AcquireTokenAsync(IEnumerable<String>, String) AcquireTokenAsync(IEnumerable<String>, String)

Interactive request to acquire token.

AcquireTokenAsync(IEnumerable<String>, String, UIBehavior, String) AcquireTokenAsync(IEnumerable<String>, String, UIBehavior, String) AcquireTokenAsync(IEnumerable<String>, String, UIBehavior, String)

Interactive request to acquire token.

AcquireTokenAsync(IEnumerable<String>, String, UIBehavior, String, IEnumerable<String>, String) AcquireTokenAsync(IEnumerable<String>, String, UIBehavior, String, IEnumerable<String>, String) AcquireTokenAsync(IEnumerable<String>, String, UIBehavior, String, IEnumerable<String>, String)

Interactive request to acquire token.

AcquireTokenAsync(IEnumerable<String>, String, UIBehavior, String, IEnumerable<String>, String, UIParent) AcquireTokenAsync(IEnumerable<String>, String, UIBehavior, String, IEnumerable<String>, String, UIParent) AcquireTokenAsync(IEnumerable<String>, String, UIBehavior, String, IEnumerable<String>, String, UIParent)

Interactive request to acquire token.

AcquireTokenAsync(IEnumerable<String>, String, UIBehavior, String, UIParent) AcquireTokenAsync(IEnumerable<String>, String, UIBehavior, String, UIParent) AcquireTokenAsync(IEnumerable<String>, String, UIBehavior, String, UIParent)

Interactive request to acquire token.

AcquireTokenAsync(IEnumerable<String>, String, UIParent) AcquireTokenAsync(IEnumerable<String>, String, UIParent) AcquireTokenAsync(IEnumerable<String>, String, UIParent)

Interactive request to acquire token.

AcquireTokenAsync(IEnumerable<String>, UIParent) AcquireTokenAsync(IEnumerable<String>, UIParent) AcquireTokenAsync(IEnumerable<String>, UIParent)

Interactive request to acquire token.

AcquireTokenSilentAsync(IEnumerable<String>, IUser) AcquireTokenSilentAsync(IEnumerable<String>, IUser) AcquireTokenSilentAsync(IEnumerable<String>, IUser)

Attempts to acquire the access token from cache. Access token is considered a match if it AT LEAST contains all the requested scopes. This means that an access token with more scopes than requested could be returned as well. If access token is expired or close to expiration (within 5 minute window), then refresh token (if available) is used to acquire a new access token by making a network call.

(Inherited from ClientApplicationBase)
AcquireTokenSilentAsync(IEnumerable<String>, IUser, String, Boolean) AcquireTokenSilentAsync(IEnumerable<String>, IUser, String, Boolean) AcquireTokenSilentAsync(IEnumerable<String>, IUser, String, Boolean)

Attempts to acquire the access token from cache. Access token is considered a match if it AT LEAST contains all the requested scopes. This means that an access token with more scopes than requested could be returned as well. If access token is expired or close to expiration (within 5 minute window), then refresh token (if available) is used to acquire a new access token by making a network call.

(Inherited from ClientApplicationBase)
GetUser(String) GetUser(String) GetUser(String)

Get user by identifier from users available in the cache.

(Inherited from ClientApplicationBase)
Remove(IUser) Remove(IUser) Remove(IUser)

Removes all cached tokens for the specified user.

(Inherited from ClientApplicationBase)

Properties

Authority Authority Authority Inherited from ClientApplicationBase
ClientId ClientId ClientId

Will be a default value. Can be overridden by the developer. Once set, application will bind to the client Id.

(Inherited from ClientApplicationBase)
Component Component Component

Identifier of the component consuming MSAL and it is intended for libraries/SDKs that consume MSAL. This will allow for disambiguation between MSAL usage by the app vs MSAL usage by component libraries.

(Inherited from ClientApplicationBase)
RedirectUri RedirectUri RedirectUri

Redirect Uri configured in the app registration portal. PublicClientApplication has a default value of urn:ietf:wg:oauth:2.0:oob.This default does not apply to iOS and Android as the library needs to leverage system webview for authentication.

(Inherited from ClientApplicationBase)
SliceParameters SliceParameters SliceParameters

Sets or Gets the custom query parameters that may be sent to the STS for dogfood testing. This parameter should not be set by the developers as it may have adverse effect on the application.

(Inherited from ClientApplicationBase)
Users Users Users

Returns a User centric view over the cache that provides a list of all the available users in the cache for the application.

(Inherited from ClientApplicationBase)
ValidateAuthority ValidateAuthority ValidateAuthority

Gets/sets a value indicating whether authority validation is ON or OFF. Value is true by default. It should be set to false by the deveopers for B2C applications.

(Inherited from ClientApplicationBase)

Fields

DefaultAuthority DefaultAuthority DefaultAuthority Inherited from ClientApplicationBase

Extension Methods

IsDefined(Object) IsDefined(Object) IsDefined(Object)

Determines if a certain property is defined or not.

IsNull(Object) IsNull(Object) IsNull(Object)

Determines if a certain property is null or not.

IsPrimitive(Object) IsPrimitive(Object) IsPrimitive(Object)

Determines if a certain property is of premitive JSON type.

Applies to