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() |
boolean |
autoDetectRegion() |
String |
azureRegion() |
protected abstract com.nimbusds.oauth2.sdk.auth.ClientAuthentication |
clientAuthentication() |
String |
clientCapabilities() |
String |
clientId() |
String |
correlationId() |
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()
Sets HTTP client to be used by the client application for all HTTP requests.
|
boolean |
instanceDiscovery() |
boolean |
logPii() |
Proxy |
proxy() |
CompletableFuture<Void> |
removeAccount(IAccount account)
Removes IAccount from the cache
|
SSLSocketFactory |
sslSocketFactory() |
TokenCache |
tokenCache() |
boolean |
validateAuthority() |
connectTimeoutForDefaultHttpClient, correlationId, httpClient, logPii, proxy, readTimeoutForDefaultHttpClient, sslSocketFactory
protected String azureRegion
public static final String DEFAULT_AUTHORITY
protected abstract com.nimbusds.oauth2.sdk.auth.ClientAuthentication clientAuthentication()
public TokenCache tokenCache()
public CompletableFuture<IAuthenticationResult> acquireToken(AuthorizationCodeParameters parameters)
parameters
- AuthorizationCodeParameters
CompletableFuture
object representing the IAuthenticationResult
of the call.public CompletableFuture<IAuthenticationResult> acquireToken(RefreshTokenParameters parameters)
parameters
- RefreshTokenParameters
CompletableFuture
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 toacquireToken(AuthorizationCodeParameters)
to be exchanged for a token
parameters
- AuthorizationRequestUrlParameters
public String clientId()
public String authority()
IApplicationBase.DEFAULT_AUTHORITY
public 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–2024. All rights reserved.