[PR #2969] [CLOSED] To support Active Directory authentication #16684

Closed
opened 2025-11-02 12:16:19 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2969
Author: @malweka
Created: 11/24/2017
Status: Closed

Base: masterHead: master


📝 Commits (1)

  • 999bf95 To support Active Directory authentication we need to use different value for binding and UserDN. Active directory bind on userPrincipalName attribute. e.g. %s@domain.com

📊 Changes

5 files changed (+24 additions, -12 deletions)

View changed files

📝 modules/auth/ldap/ldap.go (+15 -6)
📝 options/locale/locale_en-US.ini (+1 -0)
📝 options/locale/locale_fr-FR.ini (+1 -1)
📝 templates/admin/auth/edit.tmpl (+5 -4)
📝 templates/admin/auth/source/ldap.tmpl (+2 -1)

📄 Description

These are the changes needed to allow authentication with Active Directory using LDAP Simple Authentication.

In Active Directory the user DN doesn't usually contain the user ID. Most look like this cn:Jane Doe, cn=users, dc=domain, dc=org. When using the simple bind LDAP, we would have to use the User full name as their login if we want to also use the same DN to search for the user info in AD. Therefore separating the value we use to bind to LDAP and the one we use for searching solve allows us to authenticate with AD.

scr1

we can use the userPrincipalName to bind with Active Directory and a UserDN to search. Also, as the User DN we use to search for the user doesn't have the user ID, using fmt.sprintf is failing.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2969 **Author:** [@malweka](https://github.com/malweka) **Created:** 11/24/2017 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`999bf95`](https://github.com/go-gitea/gitea/commit/999bf951db7e8bb850c3a5b01324dd0fc868e6aa) To support Active Directory authentication we need to use different value for binding and UserDN. Active directory bind on userPrincipalName attribute. e.g. %s@domain.com ### 📊 Changes **5 files changed** (+24 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `modules/auth/ldap/ldap.go` (+15 -6) 📝 `options/locale/locale_en-US.ini` (+1 -0) 📝 `options/locale/locale_fr-FR.ini` (+1 -1) 📝 `templates/admin/auth/edit.tmpl` (+5 -4) 📝 `templates/admin/auth/source/ldap.tmpl` (+2 -1) </details> ### 📄 Description These are the changes needed to allow authentication with Active Directory using LDAP Simple Authentication. In Active Directory the user DN doesn't usually contain the user ID. Most look like this ` cn:Jane Doe, cn=users, dc=domain, dc=org`. When using the simple bind LDAP, we would have to use the User full name as their login if we want to also use the same DN to search for the user info in AD. Therefore separating the value we use to bind to LDAP and the one we use for searching solve allows us to authenticate with AD. ![scr1](https://user-images.githubusercontent.com/348391/33224999-dbb9e186-d13d-11e7-95eb-2de2d71d83a1.png) we can use the userPrincipalName to bind with Active Directory and a UserDN to search. Also, as the User DN we use to search for the user doesn't have the user ID, using fmt.sprintf is failing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:16:19 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16684