Attributes specified in LDAP authentication settings are case-sensitive #925

Closed
opened 2025-11-02 03:41:53 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @dubeg on GitHub (Jul 28, 2017).

  • Gitea version: master
  • Git version: irrelevant
  • Operating system: Windows 10
  • Database:
    • Irrelevant
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist: irrelevant

Description

I am using the LDAP module to authenticate with Active Directory. I use the attribute SamAccountName of an LDAP user to specify the username for its Gitea account created on first login.

The AD server lists the attribute as sAMAccountName. In Gitea, if I configure the LDAP source to use the attribute samaccountname as the account Username, it will not work. Gitea will not be able to retrieve the attribute and will silently use the login name as the username instead, which is not helping.

I checked the LDAP module used by Gitea. The module seemingly performs a case-sensitive comparison on attributes, as mentionned here.

This is either a problem or at least very confusing for people using LDAP. I plan to update the docs on Authentication soon.

Originally created by @dubeg on GitHub (Jul 28, 2017). - Gitea version: master - Git version: irrelevant - Operating system: Windows 10 - Database: - Irrelevant - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [ ] Not relevant - Log gist: irrelevant ## Description I am using the LDAP module to authenticate with Active Directory. I use the attribute `SamAccountName` of an LDAP user to specify the username for its Gitea account created on first login. The AD server lists the attribute as `sAMAccountName`. In Gitea, if I configure the LDAP source to use the attribute `samaccountname` as the account Username, it will not work. Gitea will not be able to retrieve the attribute and will silently use the login name as the username instead, which is not helping. I checked the LDAP module used by Gitea. The module seemingly performs a case-sensitive comparison on attributes, as mentionned [here](https://github.com/go-ldap/ldap/issues/109). This is either a problem or at least very confusing for people using LDAP. I plan to update the docs on Authentication soon.
GiteaMirror added the type/questionissue/stale labels 2025-11-02 03:41:53 -06:00
Author
Owner

@stale[bot] commented on GitHub (Feb 13, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Feb 13, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Feb 27, 2019):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Feb 27, 2019): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#925