public class MultipleAccountPublicClientApplication extends PublicClientApplication implements IMultipleAccountPublicClientApplication
PublicClientApplication.BrokerDeviceModeCallbackIMultipleAccountPublicClientApplication.GetAccountCallback, IMultipleAccountPublicClientApplication.RemoveAccountCallbackIPublicClientApplication.ApplicationCreatedListener, IPublicClientApplication.DeviceCodeFlowCallback, IPublicClientApplication.IMultipleAccountApplicationCreatedListener, IPublicClientApplication.ISingleAccountApplicationCreatedListener, IPublicClientApplication.LoadAccountsCallback, IPublicClientApplication.SignedHttpRequestRequestCallback| Modifier and Type | Method and Description |
|---|---|
void |
acquireToken(android.app.Activity activity,
java.lang.String[] scopes,
java.lang.String loginHint,
AuthenticationCallback callback)
Acquire token interactively, will pop-up webUI.
|
IAuthenticationResult |
acquireTokenSilent(java.lang.String[] scopes,
IAccount account,
java.lang.String authority)
Perform acquire token silent call.
|
void |
acquireTokenSilentAsync(java.lang.String[] scopes,
IAccount account,
java.lang.String authority,
SilentAuthenticationCallback callback)
Perform acquire token silent call.
|
IAccount |
getAccount(java.lang.String identifier)
Retrieve the IAccount object matching the identifier.
|
void |
getAccount(java.lang.String identifier,
IMultipleAccountPublicClientApplication.GetAccountCallback callback)
Retrieve the IAccount object matching the identifier.
|
java.util.List<IAccount> |
getAccounts()
Returns a List of
IAccount objects for which this application has RefreshTokens. |
void |
getAccounts(IPublicClientApplication.LoadAccountsCallback callback)
Asynchronously returns a List of
IAccount objects for which this application has RefreshTokens. |
boolean |
removeAccount(IAccount account)
Removes the Account and Credentials (tokens) for the supplied IAccount.
|
void |
removeAccount(IAccount account,
IMultipleAccountPublicClientApplication.RemoveAccountCallback callback)
Removes the Account and Credentials (tokens) for the supplied IAccount.
|
acquireToken, acquireToken, acquireTokenSilent, acquireTokenSilentAsync, acquireTokenWithDeviceCode, create, create, create, create, createMultipleAccountPublicClientApplication, createMultipleAccountPublicClientApplication, createMultipleAccountPublicClientApplication, createMultipleAccountPublicClientApplication, createSingleAccountPublicClientApplication, createSingleAccountPublicClientApplication, createSingleAccountPublicClientApplication, createSingleAccountPublicClientApplication, generateSignedHttpRequest, generateSignedHttpRequest, getConfiguration, getMsaFamilyRefreshToken, getMsaFamilyRefreshTokenWithMetadata, getOrgIdFamilyRefreshToken, getOrgIdFamilyRefreshTokenWithMetadata, getSdkVersion, isSharedDevice, saveMsaFamilyRefreshToken, saveOrgIdFamilyRefreshToken, showExpectedMsalRedirectUriInfoequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitacquireToken, acquireToken, acquireTokenSilent, acquireTokenSilentAsync, acquireTokenWithDeviceCode, generateSignedHttpRequest, generateSignedHttpRequest, getConfiguration, isSharedDevicepublic IAuthenticationResult acquireTokenSilent(java.lang.String[] scopes, IAccount account, java.lang.String authority) throws MsalException, java.lang.InterruptedException
IMultipleAccountPublicClientApplicationacquireTokenSilent in interface IMultipleAccountPublicClientApplicationscopes - The non-null array of scopes to be requested for the access token.
MSAL always sends the scopes 'openid profile offline_access'. Do not include any of these scopes in the scope parameter.account - IAccount represents the account to silently request tokens for.authority - Authority to issue the token.MsalExceptionjava.lang.InterruptedExceptionpublic void acquireTokenSilentAsync(java.lang.String[] scopes,
IAccount account,
java.lang.String authority,
SilentAuthenticationCallback callback)
IMultipleAccountPublicClientApplicationacquireTokenSilentAsync in interface IMultipleAccountPublicClientApplicationscopes - The non-null array of scopes to be requested for the access token.
MSAL always sends the scopes 'openid profile offline_access'. Do not include any of these scopes in the scope parameter.account - IAccount represents the account to silently request tokens for.authority - Authority to issue the token.callback - SilentAuthenticationCallback that is used to send the result back. The success result will be
sent back via SilentAuthenticationCallback.onSuccess(IAuthenticationResult).
Failure case will be sent back via {public void getAccounts(IPublicClientApplication.LoadAccountsCallback callback)
IAccount objects for which this application has RefreshTokens.getAccounts in interface IMultipleAccountPublicClientApplicationcallback - The callback to notify once this action has finished.public java.util.List<IAccount> getAccounts() throws java.lang.InterruptedException, MsalException
IMultipleAccountPublicClientApplicationIAccount objects for which this application has RefreshTokens.getAccounts in interface IMultipleAccountPublicClientApplicationjava.lang.InterruptedExceptionMsalExceptionpublic void getAccount(java.lang.String identifier,
IMultipleAccountPublicClientApplication.GetAccountCallback callback)
getAccount in interface IMultipleAccountPublicClientApplicationidentifier - String of the identifiercallback - The callback to notify once this action has finished.public IAccount getAccount(java.lang.String identifier) throws java.lang.InterruptedException, MsalException
IMultipleAccountPublicClientApplicationgetAccount in interface IMultipleAccountPublicClientApplicationidentifier - String of the identifierjava.lang.InterruptedExceptionMsalExceptionpublic void removeAccount(IAccount account, IMultipleAccountPublicClientApplication.RemoveAccountCallback callback)
IMultipleAccountPublicClientApplicationremoveAccount in interface IMultipleAccountPublicClientApplicationaccount - The IAccount whose entry and associated tokens should be removed.public boolean removeAccount(IAccount account) throws MsalException, java.lang.InterruptedException
IMultipleAccountPublicClientApplicationremoveAccount in interface IMultipleAccountPublicClientApplicationaccount - The IAccount whose entry and associated tokens should be removed.MsalExceptionjava.lang.InterruptedExceptionpublic void acquireToken(android.app.Activity activity,
java.lang.String[] scopes,
java.lang.String loginHint,
AuthenticationCallback callback)
IMultipleAccountPublicClientApplicationacquireToken in interface IMultipleAccountPublicClientApplicationactivity - Non-null Activity that will be used as the parent activity for launching the com.microsoft.identity.common.internal.providers.oauth2.AuthorizationActivity.scopes - The non-null array of scopes to be requested for the access token.
MSAL always sends the scopes 'openid profile offline_access'. Do not include any of these scopes in the scope parameter.loginHint - Optional. If provided, will be used as the query parameter sent for authenticating the user,
which will have the UPN pre-populated.callback - The Non-null AuthenticationCallback to receive the result back.
1) If user cancels the flow by pressing the device back button, the result will be sent
back via AuthenticationCallback.onCancel().
2) If the sdk successfully receives the token back, result will be sent back via
SilentAuthenticationCallback.onSuccess(IAuthenticationResult)
3) All the other errors will be sent back via
SilentAuthenticationCallback.onError(MsalException).