User Sign Up/Sign In

Add new User Sign Up and Sign In

We almost have everything we need to sign up and login as a user. Lets check whether the Cognito federated identities have been set up correctly.

  1. Open Amazon Cognito in the console and click on Manage Identity Pools
  2. Open the TravelBuddy identity pool by clicking on its title.
  3. Click on Edit identity pool in the top right hand corner

Here we can set up Unauthenticated roles (roles which are assumed when a user is not signed in), and Authenticated roles (roles which are assumed when a user is signed in).

  1. Verify that the Unauthenticated role is set to the role that contains the string CognitoIAMUnauthenticatedRole. This was created during lab setup.
  2. Verify that Authenticated role is set to the role that contains the string CognitoIAMAuthenticatedRole. This was also created during lab setup.

TravelBuddy

You now have everything in place to register and sign-in as a user, and then test the signed-in behaviour of the /trips microservice now that it is protected by requiring authorization.

  1. In the TravelBuddy web page, click Login or Register in the top navigation bar
  2. Click Sign-up here!
  3. Fill out the details to create your account.

Note that you must provide a valid email address and one that you have access to immediately, in order to retrieve the verification code you will be sent.

TravelBuddy

  1. Check your email, retrieve the verification code, and enter it into the Registration Verification Code dialog that appears. Click Verify.

TravelBuddy

  1. Sign-in using the credentials (email address and password) you provided during registration.

TravelBuddy

  1. You will now be signed in, and the banner will change to show My Account. Click the link - the only feature that is implemented is the Logout option.

TravelBuddy

You can log out and then log back in again as you wish.

  1. Now that you are signed in, click the Go! button again without any text entered.

Note that you are shown the full trips list in a dialog, as before we secured the call.

Now, sign out using the My Account menu link, and try the Go! button again.

Note that you see the error message again, indicating that you must be signed-in to use the /trips microservice.

TravelBuddy