AbstractClientApplicationBase Class

Implements

com.microsoft.aad.msal4j.IClientApplicationBase

public abstract class AbstractClientApplicationBase
extends AbstractApplicationBase
implements com.microsoft.aad.msal4j.IClientApplicationBase

Abstract class containing common methods and properties to both PublicClientApplication and ConfidentialClientApplication.

Field Summary

Modifier and Type Field and Description
protected java.lang.String azureRegion

Method Summary

Modifier and Type Method and Description
com.microsoft.aad.msal4j.AadInstanceDiscoveryResponse aadAadInstanceDiscoveryResponse()
java.util.concurrent.CompletableFuture<IAuthenticationResult> acquireToken(AuthorizationCodeParameters parameters)

Acquires security token from the authority using an authorization code previously received.

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

Acquires a security token from the authority using a refresh token previously received.

java.util.concurrent.CompletableFuture<IAuthenticationResult> acquireTokenSilently(SilentParameters parameters)

Returns tokens from cache if present and not expired or acquires new tokens from the authority by using the refresh token present in cache.

java.lang.String applicationName()
java.lang.String applicationVersion()
java.lang.String authority()
boolean autoDetectRegion()
java.lang.String azureRegion()
protected abstract com.nimbusds.oauth2.sdk.auth.ClientAuthentication clientAuthentication()
java.lang.String clientCapabilities()
java.lang.String clientId()
java.util.concurrent.CompletableFuture<java.util.Set<IAccount>> getAccounts()

Returns accounts in the cache

java.net.URL getAuthorizationRequestUrl(AuthorizationRequestUrlParameters parameters)

Computes the URL of the authorization request letting the user sign-in and consent to the application.

boolean instanceDiscovery()
java.util.concurrent.CompletableFuture<java.lang.Void> removeAccount(IAccount account)

Removes IAccount from the cache

TokenCache tokenCache()
boolean validateAuthority()

Methods inherited from AbstractApplicationBase

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Field Details

azureRegion

protected String azureRegion

Method Details

aadAadInstanceDiscoveryResponse

public AadInstanceDiscoveryResponse aadAadInstanceDiscoveryResponse()

acquireToken

public CompletableFuture acquireToken(AuthorizationCodeParameters parameters)

Acquires security token from the authority using an authorization code previously received.

Parameters:

parameters

acquireToken

public CompletableFuture acquireToken(RefreshTokenParameters parameters)

Acquires a security token from the authority using a refresh token previously received. Can be used in migration to MSAL from ADAL, and in various integration scenarios where you have a refresh token available.

Parameters:

parameters

acquireTokenSilently

public CompletableFuture acquireTokenSilently(SilentParameters parameters)

Returns tokens from cache if present and not expired or acquires new tokens from the authority by using the refresh token present in cache.

Parameters:

parameters

Throws:

java.net.MalformedURLException

applicationName

public String applicationName()

applicationVersion

public String applicationVersion()

authority

public String authority()

autoDetectRegion

public boolean autoDetectRegion()

azureRegion

public String azureRegion()

clientAuthentication

protected abstract ClientAuthentication clientAuthentication()

clientCapabilities

public String clientCapabilities()

clientId

public String clientId()

getAccounts

public CompletableFuture> getAccounts()

Returns accounts in the cache

getAuthorizationRequestUrl

public URL getAuthorizationRequestUrl(AuthorizationRequestUrlParameters parameters)

Computes the URL of the authorization request letting the user sign-in and consent to the application. The URL target the /authorize endpoint of the authority configured in the application object.

Once the user successfully authenticates, the response should contain an authorization code, which can then be passed in toacquireToken(AuthorizationCodeParameters parameters) to be exchanged for a token

Parameters:

parameters

instanceDiscovery

public boolean instanceDiscovery()

removeAccount

public CompletableFuture removeAccount(IAccount account)

Removes IAccount from the cache

Parameters:

account

tokenCache

public TokenCache tokenCache()

validateAuthority

public boolean validateAuthority()

Applies to