ARTIFACTORY: Unexpected exception in LDAP query-error code 49, username/password incorrect
Symptom:While trying to perform the LDAP authentication against Artifactory, the Login page indicates the username/password incorrect. However, the same credentials were working fine before.
Troubleshooting:To find the exact response is returned from the Artifactory server at the time of this issue, we need to look into the artifactory.log (If the Artifactory is of 6.x versions and below) & artifactory-service.log (If the Artifactory is of version 7.x version).
There are chances that the Artifactory server is unable to reach the configured LDAP server in such cases. So, by navigating to the LDAP configuration page from the Artifactory instance (using default admin privileges), perform a test connection using the below option available with the concerned user account.
If there is an issue with Artifactory in connecting to the LDAP server, we would see “Error connecting to LDAP server” error from the UI. However, to understand the exact root cause from the LDAP’s aspect, further verify the artifactory.log [or] the artifactory-service.log which would return an error message like below.
2022-09-10 08:38:20,362Z [jfrt ] [DEBUG] [e854fe2685f87073] [o.a.s.l.LdapServiceImpl:223] [tp-nio-8081-exec-519] - Unexpected exception in LDAP query: Caused by: javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C090447, comment: AcceptSecurityContext error, data 52e, v3839^@]
Despite the LDAP error code is indicated as 49, there are several reasons for the LDAP server to return this particular code. So, we need to specifically look for the “data” tag which indicates 52e in the above snippet. According to the LDAP official documentation, 52e strongly indicates an issue with the username/password combination being used.
So, even though there are no recent changes made to the user account in regards to the password part, we would need to check if there are any recent changes made at the LDAP server level recently, especially with the user binding settings, as this issue is not occurring from the Artifactory end.
Additional reference to troubleshoot the LDAP issue,
https://jfrog.com/knowledge-base/how-to-troubleshoot-ldap-configuration/