hanicz commented on code in PR #1242:
URL: https://github.com/apache/knox/pull/1242#discussion_r3317318423
##########
gateway-server/src/main/java/org/apache/knox/gateway/services/ldap/LdapMessages.java:
##########
@@ -96,4 +96,10 @@ public interface LdapMessages {
@Message(level = MessageLevel.ERROR,
text = "Failed to copy attribute: {0}")
void ldapAttributeCopyError(@StackTrace(level = MessageLevel.DEBUG)
Exception e);
+
+ @Message(level = MessageLevel.DEBUG, text = "LDAP authentication succeeded
for user: {0}")
+ void ldapAuthSucceeded(String user);
+
+ @Message(level = MessageLevel.DEBUG, text = "LDAP authentication failed
for user: {0}")
Review Comment:
I think this could be INFO level at least.
##########
gateway-server/src/main/java/org/apache/knox/gateway/services/ldap/backend/FileBackend.java:
##########
@@ -141,4 +142,25 @@ public List<Entry> searchUsers(String filter,
SchemaManager schemaManager) throw
return results;
}
+
+ @Override
+ public boolean authenticate(String userDn, String password) {
+ // Extract username from DN (e.g.,
uid=admin,ou=people,dc=hadoop,dc=apache,dc=org)
+ String username = null;
+ if (userDn != null && userDn.startsWith("uid=")) {
Review Comment:
I think the Dn class should be used to parse the user just like in
`extractUsernameFromDn` method. This parsing logic could easily break.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]