feat(auth): add LDAP/Active Directory authentication with admin UI - #38668
Open
cagriman wants to merge 1 commit into
Open
feat(auth): add LDAP/Active Directory authentication with admin UI#38668cagriman wants to merge 1 commit into
cagriman wants to merge 1 commit into
Conversation
cagriman
requested review from
CodingOnStar,
MRZHUH,
QuantumGhost,
iamjoel,
laipz8200 and
snakevash
as code owners
July 10, 2026 13:04
cagriman
force-pushed
the
feat/ldap-ad-authentication
branch
from
July 21, 2026 09:50
af05250 to
bfb2c46
Compare
## Problem Dify Community Edition previously supported only email+password login and OAuth/SSO options (SAML, OIDC) that require Enterprise licences. Organisations running self-hosted instances behind a corporate network had no way to authenticate users against their existing LDAP/Active Directory infrastructure without adding a separate identity proxy. ## Solution This commit introduces a first-class LDAP/AD integration for self-hosted Dify deployments that works with any RFC 4511-compliant directory server (OpenLDAP, Microsoft Active Directory, FreeIPA, etc.).
cagriman
force-pushed
the
feat/ldap-ad-authentication
branch
from
July 21, 2026 10:15
bfb2c46 to
b54e4f3
Compare
Author
|
@CodingOnStar @MRZHUH @QuantumGhost @iamjoel @laipz8200 @snakevash approve please? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Dify Community Edition previously supported only email+password login and OAuth/SSO options (SAML, OIDC) that require Enterprise licences. Organisations running self-hosted instances behind a corporate network had no way to authenticate users against their existing LDAP/Active Directory infrastructure without adding a separate identity proxy.
Solution
This commit introduces a first-class LDAP/AD integration for self-hosted Dify deployments that works with any RFC 4511-compliant directory server (OpenLDAP, Microsoft Active Directory, FreeIPA, etc.).
What was changed
Backend – Python / Flask
All endpoints are protected by setup_required + login_required +
is_admin_or_owner_required.
workspace) if they are not yet in the Dify database.
email+password path or raise immediately.
Frontend – Next.js / TypeScript
Tests
Behaviour
Security notes
Breaking changes
None. The feature is opt-in: unless an admin explicitly enables LDAP in the settings page the default behaviour is completely unchanged.
Important
Fixes #<issue number>.Summary
Screenshots
Checklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods