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

Matthew Swift
25.37.2013 3cbb846732b9c5cc982b73ba4039a69fb5e5794c
Additional fix for OPENDJ-694: Implement HTTP BASIC authentication

* don't use ServletRequest.getServletContext() since it is Servlet 3 only
1 files modified
8 ■■■■ changed files
opendj3/opendj-rest2ldap-servlet/src/main/java/org/forgerock/opendj/rest2ldap/servlet/Rest2LDAPAuthnFilter.java 8 ●●●● patch | view | raw | blame | history
opendj3/opendj-rest2ldap-servlet/src/main/java/org/forgerock/opendj/rest2ldap/servlet/Rest2LDAPAuthnFilter.java
@@ -101,6 +101,7 @@
    private SearchScope searchScope = SearchScope.WHOLE_SUBTREE;
    private boolean supportAltAuthentication;
    private boolean supportHTTPBasicAuthentication = true;
    private CompletionHandlerFactory completionHandlerFactory;
    /**
     * {@inheritDoc}
@@ -139,8 +140,7 @@
         */
        final AtomicReference<Connection> savedConnection = new AtomicReference<Connection>();
        final CompletionHandler completionHandler =
                CompletionHandlerFactory.getInstance(req.getServletContext())
                        .createCompletionHandler(req, res);
                completionHandlerFactory.createCompletionHandler(req, res);
        if (completionHandler.isAsynchronous()) {
            completionHandler.addCompletionListener(new Runnable() {
                @Override
@@ -388,6 +388,10 @@
                        Rest2LDAP.configureConnectionFactory(configuration.get(
                                "ldapConnectionFactories").required(), ldapFactoryName);
                // Set the completion handler factory based on the Servlet API version.
                completionHandlerFactory =
                        CompletionHandlerFactory.getInstance(config.getServletContext());
                isEnabled = true;
            }
        } catch (final ServletException e) {