The primary interface for using the Microsoft Authentication Library (MSAL) is the PublicClientApplication. The name comes directly from the OAuth2 specification and refers to clients that cannot securely keep secrets. All mobile applications are considered public clients from an oAuth perspective.
MSAL Android divides public client applications into 2 sub-types:
- Single Account Public Client Application - Which is intended to be used by applications that only expect one account to be in use at a time
- For example: Line of business applications
- Multiple Account Public Client Applications - Which is intended to be used by B2C applications and any other application that expects a user to have multiple accounts and to want to use multiple accounts at the same time.
- For example: Email clients
PublicClientApplication includes a number of static methods for constructing different public client applications. These methods support loading configuration from a JSON configuration file. They can be called synchronously from a background thread or asynchronously from the main thread.
Note: Static methods are underlined in UML. See list of factory methods in the class diagram below.
- IPublicClientApplication
- ISingleAccountPublicClientApplication
- IMultipleAccountPublicClientApplication
- ApplicationCreatedListener
- ISingleAccountApplicationCreatedListener
- IMultipleAccountApplicationCreatedListener
- ICurrentAccountResult
- GetAccountCallback
- RemoveAccountCallback
- CurrentAccountCallback
- SignOutCallback