public interface ISingleAccountPublicClientApplication extends IPublicClientApplication
When the device is registered as 'shared', this will be the only available PublicClientApplication the app can obtain. The calling app has to support ISingleAccountPublicClientApplication if it is planning to support shared device mode.
In the shared device mode, - 'Sign-in' means that the user will be signed in to the device - not just this app. - Once an account is 'signed-in', every MSAL app on the device that support shared device mode will be able to retrieve this account, and use them to silently perform API calls. - 'Sign-out' means that user will be signed out from the device - every MSAL apps and the default browser.
Modifier and Type | Interface and Description |
---|---|
static interface |
ISingleAccountPublicClientApplication.CurrentAccountCallback
Callback for asynchronous loading of the msal IAccount account.
|
static interface |
ISingleAccountPublicClientApplication.SignOutCallback |
IPublicClientApplication.ApplicationCreatedListener, IPublicClientApplication.DeviceCodeFlowCallback, IPublicClientApplication.IMultipleAccountApplicationCreatedListener, IPublicClientApplication.ISingleAccountApplicationCreatedListener, IPublicClientApplication.LoadAccountsCallback, IPublicClientApplication.SignedHttpRequestRequestCallback
Modifier and Type | Method and Description |
---|---|
IAuthenticationResult |
acquireTokenSilent(java.lang.String[] scopes,
java.lang.String authority)
Perform acquire token silent call.
|
void |
acquireTokenSilentAsync(java.lang.String[] scopes,
java.lang.String authority,
SilentAuthenticationCallback callback)
Perform acquire token silent call.
|
ICurrentAccountResult |
getCurrentAccount()
Gets the current account and notify if the current account changes.
|
void |
getCurrentAccountAsync(ISingleAccountPublicClientApplication.CurrentAccountCallback callback)
Gets the current account and notify if the current account changes.
|
void |
signIn(android.app.Activity activity,
java.lang.String loginHint,
java.lang.String[] scopes,
AuthenticationCallback callback)
Allows a user to sign in to your application with one of their accounts.
|
void |
signIn(android.app.Activity activity,
java.lang.String loginHint,
java.lang.String[] scopes,
Prompt prompt,
AuthenticationCallback callback)
Allows a user to sign in to your application with one of their accounts.
|
void |
signInAgain(android.app.Activity activity,
java.lang.String[] scopes,
Prompt prompt,
AuthenticationCallback callback)
Reauthorizes the current account according to the supplied scopes and prompt behavior.
|
boolean |
signOut()
Signs out the current the Account and Credentials (tokens).
|
void |
signOut(ISingleAccountPublicClientApplication.SignOutCallback callback)
Signs out the current the Account and Credentials (tokens).
|
acquireToken, acquireToken, acquireTokenSilent, acquireTokenSilentAsync, acquireTokenWithDeviceCode, generateSignedHttpRequest, generateSignedHttpRequest, getConfiguration, isSharedDevice
void getCurrentAccountAsync(ISingleAccountPublicClientApplication.CurrentAccountCallback callback)
callback
- a callback to be invoked when the operation finishes.ICurrentAccountResult getCurrentAccount() throws java.lang.InterruptedException, MsalException
java.lang.InterruptedException
MsalException
void signIn(android.app.Activity activity, java.lang.String loginHint, java.lang.String[] scopes, AuthenticationCallback callback)
signInAgain(Activity, String[], Prompt, AuthenticationCallback)
or
IPublicClientApplication.acquireToken(AcquireTokenParameters)
.
Note: The authority used to make the sign in request will be either the MSAL default: https://login.microsoftonline.com/common or the default authority specified by you in your configuration
activity
- Non-null Activity
that is used as the parent activity for launching the com.microsoft.identity.common.internal.providers.oauth2.AuthorizationActivity
.loginHint
- Optional. If provided, will be used as the query parameter sent for authenticating the user,
which will have the UPN pre-populated.scopes
- The non-null array of scopes to be consented to during sign in.
MSAL always sends the scopes 'openid profile offline_access'. Do not include any of these scopes in the scope parameter.
The access token returned is for MS Graph and will allow you to query for additional information about the signed in account.callback
- AuthenticationCallback
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 {void signIn(android.app.Activity activity, java.lang.String loginHint, java.lang.String[] scopes, Prompt prompt, AuthenticationCallback callback)
signInAgain(Activity, String[], Prompt, AuthenticationCallback)
or
IPublicClientApplication.acquireToken(AcquireTokenParameters)
.
Note: The authority used to make the sign in request will be either the MSAL default: https://login.microsoftonline.com/common or the default authority specified by you in your configuration
activity
- Non-null Activity
that is used as the parent activity for launching the com.microsoft.identity.common.internal.providers.oauth2.AuthorizationActivity
.loginHint
- Optional. If provided, will be used as the query parameter sent for authenticating the user,
which will have the UPN pre-populated.scopes
- The non-null array of scopes to be consented to during sign in.
MSAL always sends the scopes 'openid profile offline_access'. Do not include any of these scopes in the scope parameter.
The access token returned is for MS Graph and will allow you to query for additional information about the signed in account.callback
- AuthenticationCallback
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 {void signInAgain(android.app.Activity activity, java.lang.String[] scopes, Prompt prompt, AuthenticationCallback callback)
Note: The authority used to make the sign in request will be either the MSAL default: https://login.microsoftonline.com/common or the default authority specified by you in your configuration.
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 consented to during sign in.
MSAL always sends the scopes 'openid profile offline_access'. Do
not include any of these scopes in the scope parameter. The access
token returned is for MS Graph and will allow you to query for
additional information about the signed in account.prompt
- Nullable. Indicates the type of user interaction that is required.
If no argument is supplied the default behavior will be used.callback
- AuthenticationCallback
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 SilentAuthenticationCallback.onError(MsalException)
.void signOut(ISingleAccountPublicClientApplication.SignOutCallback callback)
callback
- a callback to be invoked when the operation finishes.boolean signOut() throws MsalException, java.lang.InterruptedException
MsalException
java.lang.InterruptedException
void acquireTokenSilentAsync(java.lang.String[] scopes, java.lang.String authority, SilentAuthenticationCallback callback)
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.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 {IAuthenticationResult acquireTokenSilent(java.lang.String[] scopes, java.lang.String authority) throws MsalException, java.lang.InterruptedException
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.authority
- Authority to issue the token.MsalException
java.lang.InterruptedException