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()
Gets the authority URL for this application. |
| boolean | autoDetectRegion() |
| java.lang.String | azureRegion() |
| java.lang.String | clientCapabilities() |
| java.lang.String |
clientId()
Gets the client ID (application ID) for this application. |
| 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()
Gets whether the authority URL should be validated against a list of known authorities. |
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<IAuthenticationResult> acquireToken(AuthorizationCodeParameters parameters)
Acquires security token from the authority using an authorization code previously received.
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:
acquireToken
public CompletableFuture<IAuthenticationResult> acquireToken(RefreshTokenParameters parameters)
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<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.
Parameters:
Throws:
applicationName
public String applicationName()
applicationVersion
public String applicationVersion()
authority
public String authority()
Gets the authority URL for this application.
autoDetectRegion
public boolean autoDetectRegion()
azureRegion
public String azureRegion()
clientCapabilities
public String clientCapabilities()
clientId
public String clientId()
Gets the client ID (application ID) for this application.
getAccounts
public CompletableFuture<Set<IAccount>> getAccounts()
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 to acquireToken(AuthorizationCodeParameters parameters) to be exchanged for a token.
Parameters:
instanceDiscovery
public boolean instanceDiscovery()
removeAccount
public CompletableFuture<Void> removeAccount(IAccount account)
Removes IAccount from the cache
Parameters:
tokenCache
public TokenCache tokenCache()
validateAuthority
public boolean validateAuthority()
Gets whether the authority URL should be validated against a list of known authorities.