Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Do not validate email when LDAP is enabled #13605

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

RicardoE105
Copy link
Contributor

@RicardoE105 RicardoE105 commented Mar 1, 2025

Understanding the Issue

The core problem stems from a previous PR (#12375) where we started validating the email via the DTO. This created an unexpected issue for LDAP users because the "email" field might not actually contain an email address but rather a username based on LDAP configuration. The validation was rejecting non-email formats, preventing legitimate LDAP users from logging in.

Solution Approach

  1. Renaming the field from "email" to "emailOrLdapUsername" to better represent its purpose
  2. Using the updated LoginRequestDto in the frontend
  3. Only validating as an email when LDAP is disabled
  4. Adding tests to prevent regression

I note that a better long-term solution would be to separate authentication flows between administrators and LDAP members, but this larger refactoring is out of scope for this immediate fix.

Affected Users

This affects instances on [email protected] and later where LDAP is configured to use a non-email identifier (anything other than "mail").

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/CAT-672/community-issue-ldap-users-wrong-email-validation
#13462

Review / Merge checklist

@RicardoE105 RicardoE105 changed the title Do not validate email when LDAP is enabled fix(core): Do not validate email when LDAP is enabled Mar 1, 2025
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Mar 1, 2025
Copy link

codecov bot commented Mar 1, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ckages/frontend/editor-ui/src/views/SigninView.vue 77.77% 2 Missing ⚠️
packages/frontend/editor-ui/src/api/users.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@RicardoE105 RicardoE105 added the release/backport Changes that need to be backported to older releases. label Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team release/backport Changes that need to be backported to older releases.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant