use of com.amazonaws.mobile.auth.core.IdentityProvider in project aws-sdk-android by aws-amplify.
the class SignInUI method presentAuthUI.
/**
* Initiate the sign-in flow.
* Resume any previously signed-in Auth session.
* Check if the user is not signed in and present the AuthUI screen.
*/
private void presentAuthUI() {
Log.d(LOG_TAG, "Presenting the SignIn UI.");
final IdentityManager identityManager = IdentityManager.getDefaultIdentityManager();
final boolean canCancel = this.authUIConfiguration.getCanCancel();
identityManager.login(this.loginCallingActivity, new DefaultSignInResultHandler() {
@Override
public void onSuccess(Activity activity, IdentityProvider identityProvider) {
if (identityProvider != null) {
Log.d(LOG_TAG, "Sign-in succeeded. The identity provider name is available here using: " + identityProvider.getDisplayName());
startNextActivity(activity, loginNextActivity);
}
}
@Override
public boolean onCancel(Activity activity) {
// Return true to allow this.
return canCancel;
}
});
SignInActivity.startSignInActivity(this.loginCallingActivity, this.authUIConfiguration);
}
Aggregations