drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/internal/authentication/AuthorizationAuthority.java
public boolean confirm(Request request, IResponse response, URL proxyServerUrl) {
        Assert.isNotNull(request);
        Assert.isNotNull(response);

        URL resourceUrl = request.getResourceUrl();

        URL serverUrl = null;
        try {
            serverUrl = new URL(resourceUrl.getProtocol(), resourceUrl.getHost(), resourceUrl.getPort(), "/"); //$NON-NLS-1$
        } catch (MalformedURLException e) {
            return false;
        }

        String realm = authenticatorStore.getProtectionSpace(resourceUrl);
        if (realm == null) {
            return false;
        }

        Map info = null;
        String authScheme = null;

        for (int i = 0; i < authenticationSchemes.length; ++i) {
            authScheme = authenticationSchemes[i];
            info = authenticatorStore.getAuthenticationInfo(serverUrl, realm, authScheme);
            if (info != null) {
                break;
            }
        }

        if (info == null) {
            return false;
        }

        AuthorizationAuthority authority = getAuthorizationAuthority(authScheme);
        if (authority == null) {
            return false;
        }

        return authority.confirmResponse(request, response, proxyServerUrl);
    }
public boolean confirm(Request request, IResponse response, URL proxyServerUrl) {
        Assert.isNotNull(request);
        Assert.isNotNull(response);

        URL resourceUrl = request.getResourceUrl();

        URL serverUrl = null;
        try {
            serverUrl = new URL(resourceUrl.getProtocol(), resourceUrl.getHost(), resourceUrl.getPort(), "/"); //$NON-NLS-1$
        } catch (MalformedURLException e) {
            return false;
        }

        String realm = authenticatorStore.getProtectionSpace(resourceUrl);
        if (realm == null) {
            return false;
        }

        Map info = null;
        String authScheme = null;

        for (int i = 0; i < authenticationSchemes.length; ++i) {
            authScheme = authenticationSchemes[i];
            info = authenticatorStore.getAuthenticationInfo(serverUrl, realm, authScheme);
            if (info != null) {
                break;
            }
        }

        if (info == null) {
            return false;
        }

        AuthorizationAuthority authority = getAuthorizationAuthority(authScheme);
        if (authority == null) {
            return false;
        }

        return authority.confirmResponse(request, response, proxyServerUrl);
    }
Confirms whether the given response is valid by proving the server
knows the client's authentication secret (password). Moreover, the
server may wish to communicate some authentication information in the
response for the purposes of authorizing future request.

@param request the request that has already been sent
@param response the response back from the server to be verified
@param proxyServerUrl the URL of the proxy server, or <code>null</code>
if there is none
@returns a boolean indicating whether the given response is valid