Skip to content

Commit

Permalink
ARTEMIS-3542 Avoid requesting LDAP root attribute
Browse files Browse the repository at this point in the history
Check getAttributes with dn of user entry to avoid missing permissions
  • Loading branch information
MM53 authored and jbertram committed Dec 14, 2021
1 parent c502e94 commit 47e947a
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -579,7 +579,12 @@ protected boolean bindUser(DirContext context, String dn, String password) throw
context.addToEnvironment(Context.SECURITY_PRINCIPAL, dn);
context.addToEnvironment(Context.SECURITY_CREDENTIALS, password);
try {
context.getAttributes("", null);
String baseDn = getLDAPPropertyValue(ConfigKey.CONNECTION_URL).replaceFirst(".*/", ",");
String userDn = dn.replace(baseDn, "");
if (logger.isDebugEnabled()) {
logger.debug("Get user Attributes with dn " + userDn);
}
context.getAttributes(userDn, null);
isValid = true;
if (logger.isDebugEnabled()) {
logger.debug("User " + dn + " successfully bound.");
Expand Down

0 comments on commit 47e947a

Please sign in to comment.