Skip to content

PDOBasicAuth: compare email usernames case-insensitively#1629

Open
fujijin wants to merge 1 commit intosabre-io:masterfrom
fujijin:bounty/dav-1250-email-case-insensitive
Open

PDOBasicAuth: compare email usernames case-insensitively#1629
fujijin wants to merge 1 commit intosabre-io:masterfrom
fujijin:bounty/dav-1250-email-case-insensitive

Conversation

@fujijin
Copy link

@fujijin fujijin commented Mar 18, 2026

Fixes #1250

What changed

  • In PDOBasicAuth::validateUserPass, keep exact lookup first.
  • If not found and username looks like an email (contains @), perform fallback lookup using lower(uuidColumn) = lower(?).
  • Add regression test for uppercase email login against lowercase stored value.

Why

Email addresses are generally treated case-insensitively in authentication flows.
This keeps existing semantics for non-email usernames while fixing email login mismatch caused by case differences.

Validation

  • php -l lib/DAV/Auth/Backend/PDOBasicAuth.php
  • php -l tests/Sabre/DAV/Auth/Backend/AbstractPDOBasicAuthTestCase.php

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.

email addresses should be compared case-insensitive

1 participant