neulab / explainaboard_web

MIT License
8 stars 2 forks source link

Switch auth framework from AWS Cognito to GCP Identity Platform/Firebase #539

Closed lyuyangh closed 1 year ago

lyuyangh commented 1 year ago

Implements the following sign-in flow:

image

Compatibility

  1. Migration is needed. I have a script that fetches all users from AWS Cognito and then creates these users on Firebase without a password. These users become "Existing Users (from AWS)" in the flow chart. I have tested this script in dev.
  2. .env needs to be updated.
  3. explainaboard_client should not be affected but a new version of the API (explainaboard_api_client) will be released.

Issues

  1. Feel free to comment on the sign-in UI. I can make modifications.
    • @neubig I changed the background as you suggested. (Not sure if this is what you have in mind).
    • The background color is taken from the home page (@qjiang002 picked this color when she designed that page). I increase the value for the alpha tunnel to make it less transparent.
  2. The "First & Last Name" field in the sign-in form is just the "Display Name". firebaseui decided to use this instead of just "Display Name" and they do not provide a way to customize it, unfortunately. (https://github.com/firebase/firebaseui-web/issues/41) If we really want to change it, I can copy firebaseui source code into our repository (it is just one js file, one CSS file and one ts type definition file), modify this label and package it with our frontend code. It requires more work to upgrade firebaseui in the future though.
  3. Our verification email will be marked as spam by gmail. There is no way to modify the email content. I can try modifying the subject and sender to see if I can circumvent the gmail spam filter. I'll comment on this issue to give an update. image

Sign-in UI

This is what an "Exiting User (from AWS)" sees when they sign in for the first time.

image image image image

This is what a "New User (firebase)" sees when they sign up. The first two steps are the same as above so I'm skipping those.

image

After the user has confirmed their email, they can sign in as "Exiting User (firebase)".

lyuyangh commented 1 year ago

An update on "our verification/reset emails being marked as spam by Gmail" (see issue 3 in the PR description):

Changing the subject and the sender of the email templates doesn't seem to do anything. I clicked "Report not spam" for these emails in my Gmail account and they can reach my inbox now. I am not sure if this "Report not spam" thing is a global thing or if it only affects my account.

I also added "Please check your spam folder" to the instructions on the sign-in page.