pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/espocrm/espocrm/pull/3657

/pull-requests-be6017ec12798e73.css" /> LDAP: add local auth fallback for regular users by kboykov · Pull Request #3657 · espocrm/espocrm · GitHub
Skip to content

LDAP: add local auth fallback for regular users - #3657

Open
kboykov wants to merge 2 commits into
espocrm:masterfrom
kboykov:ldap-local-auth-fallback
Open

LDAP: add local auth fallback for regular users#3657
kboykov wants to merge 2 commits into
espocrm:masterfrom
kboykov:ldap-local-auth-fallback

Conversation

@kboykov

@kboykov kboykov commented Apr 29, 2026

Copy link
Copy Markdown

Closes #1948.

Currently, when LDAP authentication is enabled, only admin users can fall back to local Espo authentication (when the LDAP server is unreachable or the user is not found in LDAP). Regular users — such as contractors and partners who are not present in the LDAP/AD tree — have no fallback at all. There is also no fallback of any kind when LDAP accepts a user's DN but rejects the password bind.

This PR adds an opt-in ldapFallbackToLocalAuth config flag (default: false, so existing behaviour is fully preserved). When enabled:

  • Any non-API, non-system user with a local Espo password can authenticate via local auth if LDAP is unavailable.
  • The same fallback applies when the user is not found in LDAP (the primary use case from LDAP Authentication fallback method #1948 — users such as contractors not present in AD).
  • A new fallback covers the LDAP password-bind failure case, which previously had no fallback even for admins.

The existing adminLogin() method is left untouched. A new localLogin() method handles the broader user scope, with the same type exclusions as the downstream user lookup (TYPE_API, TYPE_SYSTEM, TYPE_SUPER_ADMIN).

When `ldapFallbackToLocalAuth` is set to true in config, any non-API
non-system user with a local password can authenticate via Espo's local
auth if LDAP is unavailable or rejects the credentials. This extends the
existing admin-only fallback to cover all user types, and also adds
fallback coverage for the case where LDAP accepts the user's DN but
rejects the password bind — a path that previously had no fallback at all.

Default is false, preserving existing behaviour.
@kboykov

kboykov commented Apr 29, 2026

Copy link
Copy Markdown
Author

@kboykov
kboykov force-pushed the ldap-local-auth-fallback branch from 4c88f9d to 4bdb74e Compare April 29, 2026 14:52
@yurikuzn

Copy link
Copy Markdown
Contributor

Hi,

Thanks for the PR.

I'm not sure it's good to replicate the same fallback mechanism that we have for admins for regular users. The existing mechanism that it falls back on authentication failure is not a nice approach. I'm not sure we need to continue with the same approach.

@diusazzad

Copy link
Copy Markdown

Hi @kboykov, solid work on the LDAP fallback logic.Quick question regarding naming: In localLogin, we're using $adminUser even for non-admin users. It feels a bit misleading. Would you mind renaming that to just $user or $authenticatedUser to keep things clear?Otherwise, everything else (especially the #[SensitiveParameter] usage) looks great.

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.

LDAP Authentication fallback method

3 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy