public abstract class AbstractClientApplicationBase extends AbstractApplicationBase
PublicClientApplication
and ConfidentialClientApplication.| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractClientApplicationBase.Builder<T extends AbstractClientApplicationBase.Builder<T>> |
| Modifier and Type | Field and Description |
|---|---|
protected String |
azureRegion |
static String |
DEFAULT_AUTHORITY |
authenticationAuthority, log, tokenCache| Modifier and Type | Method and Description |
|---|---|
com.microsoft.aad.msal4j.AadInstanceDiscoveryResponse |
aadAadInstanceDiscoveryResponse() |
CompletableFuture<IAuthenticationResult> |
acquireToken(AuthorizationCodeParameters parameters)
Acquires security token from the authority using an authorization code previously received.
|
CompletableFuture<IAuthenticationResult> |
acquireToken(RefreshTokenParameters parameters)
Acquires a security token from the authority using a refresh token previously received.
|
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.
|
String |
applicationName() |
String |
applicationVersion() |
String |
authority()
Gets the authority URL for this application.
|
boolean |
autoDetectRegion() |
String |
azureRegion() |
String |
clientCapabilities() |
String |
clientId()
Gets the client ID (application ID) for this application.
|
String |
correlationId()
Gets the correlation ID used for tracing requests through the authentication system.
|
CompletableFuture<Set<IAccount>> |
getAccounts()
Returns accounts in the cache
|
URL |
getAuthorizationRequestUrl(AuthorizationRequestUrlParameters parameters)
Computes the URL of the authorization request letting the user sign-in and consent to the
application.
|
IHttpClient |
httpClient()
Gets the HTTP client used by the application for all HTTP requests.
|
boolean |
instanceDiscovery() |
boolean |
logPii()
Gets whether personally identifiable information (PII) is included in log messages.
|
Proxy |
proxy()
Gets the proxy configuration used by the application for network communication.
|
CompletableFuture<Void> |
removeAccount(IAccount account)
Removes IAccount from the cache
|
SSLSocketFactory |
sslSocketFactory()
Gets the SSL socket factory used by the application for secure network communication.
|
TokenCache |
tokenCache() |
boolean |
validateAuthority()
Gets whether the authority URL should be validated against a list of known authorities.
|
connectTimeoutForDefaultHttpClient, correlationId, httpClient, logPii, proxy, readTimeoutForDefaultHttpClient, sslSocketFactoryprotected String azureRegion
public static final String DEFAULT_AUTHORITY
public TokenCache tokenCache()
public CompletableFuture<IAuthenticationResult> acquireToken(AuthorizationCodeParameters parameters)
This is typically used as the second step in an authorization code flow, after the user has authenticated and provided consent at the authorization endpoint, resulting in an authorization code.
parameters - AuthorizationCodeParameters containing the authorization code and other information
required to exchange the code for tokensCompletableFuture object representing the IAuthenticationResult of the call,
which contains the requested tokens and account informationpublic CompletableFuture<IAuthenticationResult> acquireToken(RefreshTokenParameters parameters)
parameters - RefreshTokenParametersCompletableFuture object representing the IAuthenticationResult of the call.public CompletableFuture<IAuthenticationResult> acquireTokenSilently(SilentParameters parameters) throws MalformedURLException
parameters - instance of SilentParametersCompletableFuture object representing the IAuthenticationResult of the call.MalformedURLException - if authorityUrl from parameters is malformed URLpublic CompletableFuture<Set<IAccount>> getAccounts()
public CompletableFuture<Void> removeAccount(IAccount account)
account - instance of Account to be removed from cacheCompletableFuture object representing account removal task.public URL getAuthorizationRequestUrl(AuthorizationRequestUrlParameters parameters)
Once the user successfully authenticates, the response should contain an authorization code,
which can then be passed in to acquireToken(AuthorizationCodeParameters)
to be exchanged for a token.
parameters - AuthorizationRequestUrlParameters containing the details needed to create the authorization URL,
such as scopes, response type, and redirect URIpublic String clientId()
public String authority()
IApplicationBase.DEFAULT_AUTHORITYpublic boolean validateAuthority()
public String applicationName()
public String applicationVersion()
public com.microsoft.aad.msal4j.AadInstanceDiscoveryResponse aadAadInstanceDiscoveryResponse()
public String clientCapabilities()
public boolean autoDetectRegion()
public String azureRegion()
public boolean instanceDiscovery()
public boolean logPii()
public String correlationId()
public IHttpClient httpClient()
public Proxy proxy()
public SSLSocketFactory sslSocketFactory()
Copyright © 2013–2025. All rights reserved.