mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Yannick Lecaillez
03.15.2016 aaa73b388f25a55f7902e0b9f6630fea83b59741
OPENDJ-3077: Http Basic authorization must use the LDAPContext to get a
connection

The HttpBasicAuthenticationMechanism allocated a connection to the
directory server from the ConnectionFactory while it should get it from
the LDAPContext to be able to perform multiple concurrent asynchronous
LDAP requests and for tracking.
1 files modified
7 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/protocols/http/authz/HttpBasicAuthorizationMechanism.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/http/authz/HttpBasicAuthorizationMechanism.java
@@ -127,10 +127,9 @@
      {
        final Entry userEntry = getMappedIdentity(username);
        doBind(userEntry.getName().toString(), password);
        final Connection connection =
            parentContext.asContext(LDAPContext.class)
                         .getInternalConnectionFactory()
                         .getAuthenticatedConnection(userEntry);
        final Connection connection = parentContext.asContext(LDAPContext.class)
                                                   .getInternalConnectionFactory()
                                                   .getAuthenticatedConnection(userEntry);
        final Context authcContext = new AuthenticatedConnectionContext(parentContext, connection);
        final Map<String, Object> authz = new HashMap<>();
        authz.put(AUTHZID_DN, userEntry.getName().toString());