public class ConfidentialClientApplication extends Object implements IConfidentialClientApplication
| Modifier and Type | Class and Description |
|---|---|
static class |
ConfidentialClientApplication.Builder |
| Modifier and Type | Field and Description |
|---|---|
protected com.microsoft.aad.msal4j.Authority |
authenticationAuthority |
protected com.nimbusds.oauth2.sdk.auth.ClientAuthentication |
clientAuthentication |
protected org.slf4j.Logger |
log |
protected TokenCache |
tokenCache |
DEFAULT_AUTHORITY| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<IAuthenticationResult> |
acquireToken(AuthorizationCodeParameters parameters)
Acquires security token from the authority using an authorization code previously received.
|
CompletableFuture<IAuthenticationResult> |
acquireToken(ClientCredentialParameters parameters)
Acquires tokens from the authority configured in the application, for the confidential client
itself
|
CompletableFuture<IAuthenticationResult> |
acquireToken(OnBehalfOfParameters parameters)
Acquires an access token for this application (usually a Web API) from the authority configured
in the application, in order to access another downstream protected Web API on behalf of a user
using the On-Behalf-Of flow.
|
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 |
authority() |
static ConfidentialClientApplication.Builder |
builder(String clientId,
IClientCredential clientCredential)
Creates instance of Builder of ConfidentialClientApplication
|
protected static String |
canonicalizeUrl(String authority) |
String |
clientId() |
String |
correlationId() |
CompletableFuture<Set<IAccount>> |
getAccounts()
Returns accounts in the cache
|
boolean |
logPii() |
Proxy |
proxy() |
CompletableFuture |
removeAccount(IAccount account)
Removes IAccount from the cache
|
SSLSocketFactory |
sslSocketFactory() |
Consumer<List<HashMap<String,String>>> |
telemetryConsumer() |
TokenCache |
tokenCache() |
boolean |
validateAuthority() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitacquireToken, acquireToken, acquireTokenSilently, authority, clientId, correlationId, getAccounts, logPii, proxy, removeAccount, sslSocketFactory, telemetryConsumer, tokenCache, validateAuthorityprotected org.slf4j.Logger log
protected com.nimbusds.oauth2.sdk.auth.ClientAuthentication clientAuthentication
protected com.microsoft.aad.msal4j.Authority authenticationAuthority
protected TokenCache tokenCache
public CompletableFuture<IAuthenticationResult> acquireToken(ClientCredentialParameters parameters)
IConfidentialClientApplicationacquireToken in interface IConfidentialClientApplicationparameters - instance of ClientCredentialParametersCompletableFuture containing an IAuthenticationResultpublic CompletableFuture<IAuthenticationResult> acquireToken(OnBehalfOfParameters parameters)
IConfidentialClientApplicationUserAssertion to the OnBehalfOfParametersacquireToken in interface IConfidentialClientApplicationparameters - instance of OnBehalfOfParametersCompletableFuture containing an IAuthenticationResultpublic static ConfidentialClientApplication.Builder builder(String clientId, IClientCredential clientCredential)
clientId - Client ID (Application ID) of the application as registered
in the application registration portal (portal.azure.com)clientCredential - The client credential to use for token acquisition.public Proxy proxy()
proxy in interface IClientApplicationBasepublic SSLSocketFactory sslSocketFactory()
sslSocketFactory in interface IClientApplicationBasepublic CompletableFuture<IAuthenticationResult> acquireToken(AuthorizationCodeParameters parameters)
IClientApplicationBaseacquireToken in interface IClientApplicationBaseparameters - AuthorizationCodeParametersCompletableFuture object representing the IAuthenticationResult of the call.public CompletableFuture<IAuthenticationResult> acquireToken(RefreshTokenParameters parameters)
IClientApplicationBaseacquireToken in interface IClientApplicationBaseparameters - RefreshTokenParametersCompletableFuture object representing the IAuthenticationResult of the call.public CompletableFuture<IAuthenticationResult> acquireTokenSilently(SilentParameters parameters) throws MalformedURLException
IClientApplicationBaseacquireTokenSilently in interface IClientApplicationBaseparameters - instance of SilentParametersCompletableFuture object representing the IAuthenticationResult of the call.MalformedURLException - if authorityUrl from parameters is malformed URLpublic CompletableFuture<Set<IAccount>> getAccounts()
IClientApplicationBasegetAccounts in interface IClientApplicationBasepublic CompletableFuture removeAccount(IAccount account)
IClientApplicationBaseremoveAccount in interface IClientApplicationBaseaccount - instance of Account to be removed from cacheCompletableFuture object representing account removal task.public String clientId()
clientId in interface IClientApplicationBasepublic String authority()
authority in interface IClientApplicationBaseIClientApplicationBase.DEFAULT_AUTHORITYpublic boolean validateAuthority()
validateAuthority in interface IClientApplicationBasepublic String correlationId()
correlationId in interface IClientApplicationBasepublic boolean logPii()
logPii in interface IClientApplicationBasepublic Consumer<List<HashMap<String,String>>> telemetryConsumer()
telemetryConsumer in interface IClientApplicationBasepublic TokenCache tokenCache()
tokenCache in interface IClientApplicationBaseIClientApplicationBase.acquireTokenSilently(SilentParameters)Copyright © 2013–2019. All rights reserved.