Designing custom sign in flow/activity for Cognito

823 views Asked by At

I am following the Amazon cognito user signin guide here: http://docs.aws.amazon.com/mobile-hub/latest/developerguide/add-aws-mobile-user-sign-in-email-and-password.html#email-and-password-config-overview

It all works perfectly, but the default activity they launch is ugly and surprisingly hard to use. The code they use to launch this activity is

    AuthUIConfiguration config =
            new AuthUIConfiguration.Builder().userPools(true).build();

    Context context = SplashActivity.this;
    SignInActivity.startSignInActivity(context, config);

I would like to build my own sign in flow. Is that even possible? Is there a tutorial out there on how to do this?

I am cant their flow, because when I follow the link to SignInActivity, I get ...\.grade\caches\ modules-2\files-2.1\com.amazonaws\aws-android-sdk-auth-ui\2.6.0\991ae12d55d8733e2ebb4b3e4c30a6cc2ee42d3a\aws-android-sdk-auth-ui-2.6.0-sources.jar!\com\amazonaws\mo and the file is locked for editing.

2

There are 2 answers

2
Adrian Hall On BEST ANSWER

The SignInActivity is just another activity. You can find the source code here. There is no reason you can't take a copy of this activity, then replace the UI with your own UI. This is probably the easiest mechanism to adjust the UI to your liking.

5
AudioBubble On

We have recently worked on the AWS mobile app and we know that only cloning the SigninActivity Code won't work. You would need to clone SigninView, UserPoolSignInView, and CognitoUserPoolsSignInProvider. We had added a progressbar in the layout and set the visibility on the click event of the buttonview.

I hope these instructions should help.

Cheers, Kapil