Wrong log entry when LDAP user enters wrong password #14699

Open
opened 2025-11-02 11:20:27 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @urz-hgw on GitHub (Jul 3, 2025).

Description

Hi,

while debugging other issues I noticed that the log message differs between LDAP users and local users in case of a wrong password.

gitea-1    | 2025/07/03 11:53:08 routers/web/auth/auth.go:222:SignInPost() [W] Failed authentication attempt for LDAPUSER from 10.128.1.1:60904: user does not exist [uid: 0, name: LDAPUSER]
gitea-1    | 2025/07/03 11:53:22 routers/web/auth/auth.go:222:SignInPost() [W] Failed authentication attempt for LOCALUSER from 10.128.1.1:60904: user's password is invalid [uid: 1, name: LOCALUSER]

This is a bit confusing since the LDAPUSER does exist in gitea and the ldap return value for invalid credentials should be detectable to write the same error message for ldap users.

Best regards
Daniel

Gitea Version

1.24.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

1.24.2

Operating System

Debian

How are you running Gitea?

Docker default image

Database

MySQL/MariaDB

Originally created by @urz-hgw on GitHub (Jul 3, 2025). ### Description Hi, while debugging other issues I noticed that the log message differs between LDAP users and local users in case of a wrong password. ``` gitea-1 | 2025/07/03 11:53:08 routers/web/auth/auth.go:222:SignInPost() [W] Failed authentication attempt for LDAPUSER from 10.128.1.1:60904: user does not exist [uid: 0, name: LDAPUSER] gitea-1 | 2025/07/03 11:53:22 routers/web/auth/auth.go:222:SignInPost() [W] Failed authentication attempt for LOCALUSER from 10.128.1.1:60904: user's password is invalid [uid: 1, name: LOCALUSER] ``` This is a bit confusing since the LDAPUSER does exist in gitea and the ldap return value for invalid credentials should be detectable to write the same error message for ldap users. Best regards Daniel ### Gitea Version 1.24.2 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 1.24.2 ### Operating System Debian ### How are you running Gitea? Docker default image ### Database MySQL/MariaDB
GiteaMirror added the topic/authenticationtype/bug labels 2025-11-02 11:20:27 -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#14699