AbstractClientApplicationBase Class
- java.
lang. Object - com.
microsoft. aad. msal4j. AbstractApplicationBase - com.
microsoft. aad. msal4j. AbstractClientApplicationBase
- com.
- com.
Implements
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<IAuthentication |
acquireToken(AuthorizationCodeParameters parameters)
Acquires security token from the authority using an authorization code previously received. |
java.util.concurrent.CompletableFuture<IAuthentication |
acquireToken(RefreshTokenParameters parameters)
Acquires a security token from the authority using a refresh token previously received. |
java.util.concurrent.CompletableFuture<IAuthentication |
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 |
Token |
tokenCache() |
boolean | validateAuthority() |
Methods inherited from AbstractApplicationBase
Methods inherited from java.lang.Object
Field Details
azureRegion
protected String azureRegion
Method Details
aadAadInstanceDiscoveryResponse
public AadInstanceDiscoveryResponse aadAadInstanceDiscoveryResponse()
acquireToken
public CompletableFuture
Acquires security token from the authority using an authorization code previously received.
Parameters:
acquireToken
public CompletableFuture
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:
acquireTokenSilently
public CompletableFuture
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:
Throws:
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
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:
instanceDiscovery
public boolean instanceDiscovery()
removeAccount
public CompletableFuture
Removes IAccount from the cache
Parameters:
tokenCache
public TokenCache tokenCache()
validateAuthority
public boolean validateAuthority()