public interface IConfidentialClientApplication
Modifier and Type | Field and Description |
---|---|
static String |
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() |
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.
|
boolean |
logPii() |
Proxy |
proxy() |
CompletableFuture |
removeAccount(IAccount account)
Removes IAccount from the cache
|
boolean |
sendX5c() |
SSLSocketFactory |
sslSocketFactory() |
ITokenCache |
tokenCache() |
boolean |
validateAuthority() |
static final String DEFAULT_AUTHORITY
boolean sendX5c()
CompletableFuture<IAuthenticationResult> acquireToken(ClientCredentialParameters parameters)
parameters
- instance of ClientCredentialParameters
CompletableFuture
containing an IAuthenticationResult
CompletableFuture<IAuthenticationResult> acquireToken(OnBehalfOfParameters parameters)
UserAssertion
field of OnBehalfOfParameters
.
When serializing/deserializing the in-memory token cache to permanent storage, there should be
a token cache per incoming access token, where the hash of the incoming access token can be used
as the token cache key. Access tokens are usually only valid for a 1 hour period of time,
and a new access token in the UserAssertion
means there will be a new token cache and
new token cache key. To avoid your permanent storage from being filled with expired
token caches, an eviction policy should be set. For example, a token cache that
is more than a couple of hours old can be deemed expired and therefore evicted from the
serialized token cache.
parameters
- instance of OnBehalfOfParameters
CompletableFuture
containing an IAuthenticationResult
String clientId()
String authority()
IClientApplicationBase.DEFAULT_AUTHORITY
boolean validateAuthority()
String correlationId()
boolean logPii()
Proxy proxy()
SSLSocketFactory sslSocketFactory()
ITokenCache tokenCache()
IClientApplicationBase.acquireTokenSilently(SilentParameters)
URL getAuthorizationRequestUrl(AuthorizationRequestUrlParameters parameters)
Once the user successfully authenticates, the response should contain an authorization code,
which can then be passed in toAbstractClientApplicationBase.acquireToken(AuthorizationCodeParameters)
to be exchanged for a token
parameters
- AuthorizationRequestUrlParameters
CompletableFuture<IAuthenticationResult> acquireToken(AuthorizationCodeParameters parameters)
parameters
- AuthorizationCodeParameters
CompletableFuture
object representing the IAuthenticationResult
of the call.CompletableFuture<IAuthenticationResult> acquireToken(RefreshTokenParameters parameters)
parameters
- RefreshTokenParameters
CompletableFuture
object representing the IAuthenticationResult
of the call.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 URLCompletableFuture<Set<IAccount>> getAccounts()
CompletableFuture removeAccount(IAccount account)
account
- instance of Account to be removed from cacheCompletableFuture
object representing account removal task.Copyright © 2013–2022. All rights reserved.