PublicClientApplication Class
- java.
lang. Object - com.
microsoft. aad. msal4j. AbstractApplicationBase - com.
microsoft. aad. msal4j. AbstractClientApplicationBase - com.
microsoft. aad. msal4j. PublicClientApplication
- com.
- com.
- com.
Implements
public class PublicClientApplication
extends AbstractClientApplicationBase
implements IPublicClientApplication
Class to be used to acquire tokens for public client applications (Desktop, Mobile). For details see IPublicClientApplication
Conditionally thread-safe
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.CompletableFuture<IAuthentication |
acquire Acquires security token from the authority using an device code flow. |
java.util.concurrent.CompletableFuture<IAuthentication |
acquire Acquires tokens from the authority configured in the application via Integrated Windows Authentication. |
java.util.concurrent.CompletableFuture<IAuthentication |
acquire Acquires tokens from the authority using authorization code grant. |
java.util.concurrent.CompletableFuture<IAuthentication |
acquire Acquires tokens from the authority configured in the application via Username/Password authentication. |
java.util.concurrent.CompletableFuture<IAuthentication |
acquire Returns tokens from cache if present and not expired or acquires new tokens from the authority by using the refresh token present in cache. |
static Builder |
builder(String client |
protected com.nimbusds.oauth2.sdk.auth.ClientAuthentication |
client |
java.util.concurrent.CompletableFuture<java.lang.Void> |
remove Removes IAccount from the cache |
Methods inherited from AbstractApplicationBase
Methods inherited from AbstractClientApplicationBase
acquireToken
public CompletableFuture
Acquires security token from the authority using an device code flow. Flow is designed for devices that do not have access to a browser or have input constraints. The authorization server issues DeviceCode object with verification code, an end-user code and the end-user verification URI. DeviceCode is provided through deviceCodeConsumer callback. End-user should be instructed to use another device to connect to the authorization server to approve the access request. Since the client cannot receive incoming requests, it polls the authorization server repeatedly until the end-user completes the approval process.
Parameters:
acquireToken
public CompletableFuture
Acquires tokens from the authority configured in the application via Integrated Windows Authentication.
Parameters:
acquireToken
public CompletableFuture
Acquires tokens from the authority using authorization code grant. Will attempt to open the default system browser where the user can input the credentials interactively, consent to scopes, and do multi-factor authentication if such a policy is enabled on the Azure AD tenant. System browser can behavior can be customized via InteractiveRequestParameters#systemBrowserOptions. For more information, see https://aka.ms/msal4j-interactive-request
Parameters:
acquireToken
public CompletableFuture
Acquires tokens from the authority configured in the application via Username/Password authentication.
Parameters:
acquireTokenSilently
public CompletableFuture
Returns tokens from cache if present and not expired or acquires new tokens from the authority by using the refresh token present in cache.
Overrides:
PublicClientApplication.acquireTokenSilently(SilentParameters parameters)Parameters:
Throws:
builder
public static PublicClientApplication.Builder builder(String clientId)
Parameters:
Returns:
clientAuthentication
protected ClientAuthentication clientAuthentication()
Overrides:
PublicClientApplication.clientAuthentication()removeAccount
public CompletableFuture
Removes IAccount from the cache
Overrides:
PublicClientApplication.removeAccount(IAccount account)Parameters: