public interface IBroker
All methods are marked as default so they can be referenced by MSAL Java without an implementation, and most will simply throw an exception if not overridden by an IBroker implementation
| Modifier and Type | Method and Description |
|---|---|
default CompletableFuture<IAuthenticationResult> |
acquireToken(PublicClientApplication application,
InteractiveRequestParameters parameters)
Acquire a token interactively, by prompting users to enter their credentials in some way
|
default CompletableFuture<IAuthenticationResult> |
acquireToken(PublicClientApplication application,
SilentParameters requestParameters)
Acquire a token silently, i.e.
|
default CompletableFuture<IAuthenticationResult> |
acquireToken(PublicClientApplication application,
UserNamePasswordParameters parameters)
Acquire a token silently, i.e.
|
default boolean |
isBrokerAvailable()
Returns whether a broker is available and ready to use on this machine, allowing the use of the methods
in this interface and other broker-only features in MSAL Java
|
default IAuthenticationResult |
parseBrokerAuthResult(String authority,
String idToken,
String accessToken,
String accountId,
String clientInfo,
long accessTokenExpirationTime,
boolean isPopAuthorization)
MSAL Java's AuthenticationResult requires several package-private classes that a broker implementation can't access,
so this helper method can be used to create AuthenticationResults from within the MSAL Java package
|
default void |
removeAccount(PublicClientApplication application,
IAccount account) |
default CompletableFuture<IAuthenticationResult> acquireToken(PublicClientApplication application, SilentParameters requestParameters)
This may be accomplished by returning tokens from a token cache, using cached refresh tokens to get new tokens, or via any authentication flow where a user is not prompted to enter credentials
default CompletableFuture<IAuthenticationResult> acquireToken(PublicClientApplication application, InteractiveRequestParameters parameters)
default CompletableFuture<IAuthenticationResult> acquireToken(PublicClientApplication application, UserNamePasswordParameters parameters)
default void removeAccount(PublicClientApplication application, IAccount account) throws MsalClientException
MsalClientExceptiondefault boolean isBrokerAvailable()
default IAuthenticationResult parseBrokerAuthResult(String authority, String idToken, String accessToken, String accountId, String clientInfo, long accessTokenExpirationTime, boolean isPopAuthorization)
Copyright © 2013–2024. All rights reserved.