public interface IPublicClientApplication
Modifier and Type | Interface and Description |
---|---|
static interface |
IPublicClientApplication.ApplicationCreatedListener
Listener callback for asynchronous initialization of IPublicClientApplication object.
|
static interface |
IPublicClientApplication.DeviceCodeFlowCallback
Callback object used in Device Code Flow.
|
static interface |
IPublicClientApplication.IMultipleAccountApplicationCreatedListener
Listener callback for asynchronous initialization of IMultipleAccountPublicClientApplication object.
|
static interface |
IPublicClientApplication.ISingleAccountApplicationCreatedListener
Listener callback for asynchronous initialization of ISingleAccountPublicClientApplication object.
|
static interface |
IPublicClientApplication.LoadAccountsCallback |
static interface |
IPublicClientApplication.SignedHttpRequestRequestCallback
Callback used to receive the result of
generateSignedHttpRequest(IAccount, PoPAuthenticationScheme) . |
Modifier and Type | Method and Description |
---|---|
void |
acquireToken(AcquireTokenParameters acquireTokenParameters)
Acquire token interactively, will pop-up webUI.
|
void |
acquireToken(android.app.Activity activity,
java.lang.String[] scopes,
AuthenticationCallback callback)
Acquire token interactively, will pop-up webUI.
|
IAuthenticationResult |
acquireTokenSilent(AcquireTokenSilentParameters acquireTokenSilentParameters)
Perform acquire token silent call.
|
void |
acquireTokenSilentAsync(AcquireTokenSilentParameters acquireTokenSilentParameters)
Perform acquire token silent call.
|
void |
acquireTokenWithDeviceCode(java.lang.String[] scopes,
IPublicClientApplication.DeviceCodeFlowCallback callback)
Perform the Device Code Flow (DCF) protocol to allow a device without input capability to authenticate and get a new access token.
|
java.lang.String |
generateSignedHttpRequest(IAccount account,
PoPAuthenticationScheme popParameters)
Signs the provided
PoPAuthenticationScheme parameters into a JWT on behalf of the
provided IAccount . |
void |
generateSignedHttpRequest(IAccount account,
PoPAuthenticationScheme popParameters,
IPublicClientApplication.SignedHttpRequestRequestCallback callback)
Signs the provided
PoPAuthenticationScheme parameters into a JWT on behalf of the
provided IAccount . |
PublicClientApplicationConfiguration |
getConfiguration()
Returns the PublicClientConfiguration for this instance of PublicClientApplication.
|
boolean |
isSharedDevice()
Returns whether the application is being run on a device that is marked as a shared.
|
void acquireToken(android.app.Activity activity, java.lang.String[] scopes, AuthenticationCallback callback)
Prompt
is Prompt.SELECT_ACCOUNT
.activity
- Non-null Activity
that is 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.callback
- The 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)
.void acquireToken(AcquireTokenParameters acquireTokenParameters)
Prompt
is Prompt.SELECT_ACCOUNT
.
Convey parameters via the AquireTokenParameters object
acquireTokenParameters
- void acquireTokenSilentAsync(AcquireTokenSilentParameters acquireTokenSilentParameters)
acquireTokenSilentParameters
- IAuthenticationResult acquireTokenSilent(AcquireTokenSilentParameters acquireTokenSilentParameters) throws java.lang.InterruptedException, MsalException
acquireTokenSilentParameters
- java.lang.InterruptedException
MsalException
void acquireTokenWithDeviceCode(java.lang.String[] scopes, IPublicClientApplication.DeviceCodeFlowCallback callback)
scopes
- the desired access scopescallback
- callback object used to communicate with the API throughout the protocolPublicClientApplicationConfiguration getConfiguration()
boolean isSharedDevice()
java.lang.String generateSignedHttpRequest(IAccount account, PoPAuthenticationScheme popParameters) throws MsalException
PoPAuthenticationScheme
parameters into a JWT on behalf of the
provided IAccount
.
Important: Use of this API requires setting the minimum_required_broker_protocol_version to "6.0" or higher.
account
- The account for whom signing shall occur.popParameters
- The input parameters.MsalException
void generateSignedHttpRequest(IAccount account, PoPAuthenticationScheme popParameters, IPublicClientApplication.SignedHttpRequestRequestCallback callback)
PoPAuthenticationScheme
parameters into a JWT on behalf of the
provided IAccount
.
Important: Use of this API requires setting the minimum_required_broker_protocol_version to "6.0" or higher.
account
- The account for whom signing shall occur.popParameters
- The input parameters.callback
- The callback object to receive the result (or error).