aws-solutions / aws-data-lake-solution

A deployable reference implementation intended to address pain points around conceptualizing data lake architectures that automatically configures the core AWS services necessary to easily tag, search, share, and govern specific subsets of data across a business or with other external businesses.
https://aws.amazon.com/solutions/implementations/data-lake-solution/
Apache License 2.0
401 stars 160 forks source link

Fix Forgot Password Flow: Treat email addresses as case insensitive #13

Closed TonyFNZ closed 6 years ago

TonyFNZ commented 6 years ago

The Problem In many companies, when copying an email address out of Outlook it will contain capital letters. E.g. First.Last@company.com

When inviting/register a new user with capital letters in the email address, these capital letters are maintained when deriving the Cognito username for the user. Later if the user uses the forgot password function and types their email address without capital letters the receive an error because the derived username cannot be found.

The Fix Whenever the email address is used to derive the Cognito username for the user the email address is converted to lower case first (i.e. treat the email as case insensitive).

hvital commented 6 years ago

The version 2.0 was published and toLowerCase() was added where recommended. Thanks! More info: https://aws.amazon.com/about-aws/whats-new/2018/07/the-data-lake-solution-now-transforms-and-analyzes-data/

emma-ehrhardt commented 6 years ago

This doesn't actually fully solve the problem, if it's restricted to a user forgetting their login. Currently behavior is that when a user is invited as "first.last@company.com", they still must sign in with that same casing ("First.Last@company.com" doesn't work). Likewise if they are invited as "First.Last@company.com" and try to sign-in via "first.last@company.com". In the latter case, this is worse, because their invite actually displays the lowercase version, but only the Title Case form will work. The other minor side effect is that I can no longer sign my self up as an Admin and as a Member using those casing variations (for testing purposes), since Data Lake 2.0 now does refuse to send an invite to same email address that only differs by casing.

hvital commented 6 years ago

@emma-ehrhardt Can you please copy and paste this comment to a new issue? It will help to keep track of what should be fixed for the next release.

When I incorporated this PR I didn't realize this scenario you've mentioned. It will be fixed!

shsenior commented 6 years ago

Resolved in v2.1.0 update.