Skip to content

fix: normalise email to lowercase in whitelist service#114

Open
AA-AdonayTecle wants to merge 2 commits into
yasudacloud:mainfrom
AA-AdonayTecle:fix/whitelist-email-case-sensitivity
Open

fix: normalise email to lowercase in whitelist service#114
AA-AdonayTecle wants to merge 2 commits into
yasudacloud:mainfrom
AA-AdonayTecle:fix/whitelist-email-case-sensitivity

Conversation

@AA-AdonayTecle

Copy link
Copy Markdown

Problem

Emails from OAuth providers (Azure AD, Google, Cognito, OIDC) may
contain uppercase letters depending on the provider or user profile
configuration. The whitelist lookup and registration used an exact
string match, causing valid whitelisted users to be rejected when
the case of their email differed from the stored entry.

For example, a user logging in with "John.Smith@Company.com" would
fail the whitelist check if the stored entry was "john.smith@company.com".

Fix

Call email.toLowerCase() in both "registerUser" and
"checkWhitelistForEmail" in "server/services/whitelist.js". This
ensures all storage and comparisons are case-insensitive regardless
of what the OAuth provider returns.

The fix is in the service layer rather than individual controllers
so it applies consistently across all providers (Azure AD, Google,
Cognito, OIDC).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant