Dela via


IPublicClientApplication Interface

Implements

com.microsoft.aad.msal4j.IClientApplicationBase

public interface IPublicClientApplication
extends com.microsoft.aad.msal4j.IClientApplicationBase

Interface representing a public client application (Desktop, Mobile). Public client application are not trusted to safely store application secrets, and therefore can only request tokens in the name of an user. For details see https://aka.ms/msal4jclientapplications

Method Summary

Modifier and Type Method and Description
abstract java.util.concurrent.CompletableFuture<IAuthenticationResult> acquireToken(DeviceCodeFlowParameters parameters)

Acquires security token from the authority using an device code flow.

abstract java.util.concurrent.CompletableFuture<IAuthenticationResult> acquireToken(IntegratedWindowsAuthenticationParameters parameters)

Acquires tokens from the authority configured in the application via Integrated Windows Authentication.

abstract java.util.concurrent.CompletableFuture<IAuthenticationResult> acquireToken(InteractiveRequestParameters parameters)

Acquires tokens from the authority using authorization code grant.

abstract java.util.concurrent.CompletableFuture<IAuthenticationResult> acquireToken(UserNamePasswordParameters parameters)

Acquires tokens from the authority configured in the application via Username/Password authentication.

Method Details

acquireToken

public abstract CompletableFuture acquireToken(DeviceCodeFlowParameters parameters)

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:

parameters - instance of DeviceCodeFlowParameters

Returns:

CompletableFuture containing an IAuthenticationResult

acquireToken

public abstract CompletableFuture acquireToken(IntegratedWindowsAuthenticationParameters parameters)

Acquires tokens from the authority configured in the application via Integrated Windows Authentication.

Parameters:

Returns:

CompletableFuture containing an IAuthenticationResult

acquireToken

public abstract CompletableFuture acquireToken(InteractiveRequestParameters parameters)

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:

parameters - instance of InteractiveRequestParameters

Returns:

CompletableFuture containing an IAuthenticationResult

acquireToken

public abstract CompletableFuture acquireToken(UserNamePasswordParameters parameters)

Acquires tokens from the authority configured in the application via Username/Password authentication.

Parameters:

parameters - instance of UserNamePasswordParameters

Returns:

CompletableFuture containing an IAuthenticationResult

Applies to