IBroker Interface
public interface IBroker
Used to define the basic set of methods that all Brokers must implement
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
Method Summary
Modifier and Type | Method and Description |
---|---|
default
java.util.concurrent.CompletableFuture<IAuthentication |
acquireToken(PublicClientApplication application, InteractiveRequestParameters parameters)
Acquire a token interactively, by prompting users to enter their credentials in some way |
default
java.util.concurrent.CompletableFuture<IAuthentication |
acquireToken(PublicClientApplication application, SilentParameters requestParameters)
Acquire a token silently, i. |
default
java.util.concurrent.CompletableFuture<IAuthentication |
acquireToken(PublicClientApplication application, UserNamePasswordParameters parameters)
Acquire a token silently, i. |
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
IAuthentication |
parseBrokerAuthResult(String authority, String idToken, String accessToken, String accountId, String clientInfo, long accessTokenExpirationTime, boolean isPopAuthorization)
MSAL Java's Authentication |
default void | removeAccount(PublicClientApplication application, IAccount account) |
Method Details
acquireToken
public default CompletableFuture
Acquire a token interactively, by prompting users to enter their credentials in some way
Parameters:
acquireToken
public default CompletableFuture
Acquire a token silently, i.e. without direct user interaction
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
Parameters:
acquireToken
public default CompletableFuture
Acquire a token silently, i.e. without direct user interaction, using username/password authentication
Parameters:
isBrokerAvailable
public 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
parseBrokerAuthResult
public 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
Parameters:
removeAccount
public default void removeAccount(PublicClientApplication application, IAccount account)
Parameters:
Throws: