SingleAccountPublicClientApplication.signIn Method

Definition

Overloads

signIn(@NonNull final Activity activity, @Nullable final String loginHint, @NonNull final String[] scopes, @NonNull final AuthenticationCallback callback)

Allows a user to sign in to your application with one of their accounts. This method may only be called once: once a user is signed in, they must first be signed out before another user may sign in. If you wish to prompt the existing user for credentials use signInAgain(Activity, String[], Prompt, AuthenticationCallback) or 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

signIn(@NonNull final Activity activity, @Nullable final String loginHint, @NonNull final String[] scopes, @Nullable final Prompt prompt, @NonNull final AuthenticationCallback callback)

Allows a user to sign in to your application with one of their accounts. This method may only be called once: once a user is signed in, they must first be signed out before another user may sign in. If you wish to prompt the existing user for credentials use signInAgain(Activity, String[], Prompt, AuthenticationCallback) or 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

signIn(@NonNull final Activity activity, @Nullable final String loginHint, @NonNull final String[] scopes, @NonNull final AuthenticationCallback callback)

Allows a user to sign in to your application with one of their accounts. This method may only be called once: once a user is signed in, they must first be signed out before another user may sign in. If you wish to prompt the existing user for credentials use signInAgain(Activity, String[], Prompt, AuthenticationCallback) or 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

public void signIn(@NonNull final Activity activity, @Nullable final String loginHint, @NonNull final String[] scopes, @NonNull final AuthenticationCallback callback)

Parameters

activity
@NonNull final Activity

Non-null Activity that is used as the parent activity for launching the com.microsoft.identity.common.internal.providers.oauth2.AuthorizationActivity.

loginHint
@Nullable final String

Optional. If provided, will be used as the query parameter sent for authenticating the user, which will have the UPN pre-populated.

scopes
@NonNull final String []

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
@NonNull final AuthenticationCallback

AuthenticationCallback that is used to send the result back. The success result will be sent back via onSuccess(final IAuthenticationResult authenticationResult). Failure case will be sent back via { onError(final MsalException exception)

Overrides

signIn(@NonNull final Activity activity, @Nullable final String loginHint, @NonNull final String[] scopes, @Nullable final Prompt prompt, @NonNull final AuthenticationCallback callback)

Allows a user to sign in to your application with one of their accounts. This method may only be called once: once a user is signed in, they must first be signed out before another user may sign in. If you wish to prompt the existing user for credentials use signInAgain(Activity, String[], Prompt, AuthenticationCallback) or 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

public void signIn(@NonNull final Activity activity, @Nullable final String loginHint, @NonNull final String[] scopes, @Nullable final Prompt prompt, @NonNull final AuthenticationCallback callback)

Parameters

activity
@NonNull final Activity

Non-null Activity that is used as the parent activity for launching the com.microsoft.identity.common.internal.providers.oauth2.AuthorizationActivity.

loginHint
@Nullable final String

Optional. If provided, will be used as the query parameter sent for authenticating the user, which will have the UPN pre-populated.

scopes
@NonNull final String []

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 final Prompt
callback
@NonNull final AuthenticationCallback

AuthenticationCallback that is used to send the result back. The success result will be sent back via onSuccess(final IAuthenticationResult authenticationResult). Failure case will be sent back via { onError(final MsalException exception)

Overrides

Applies to