@Override protected AuthenticationHandlerResponse authenticateInternal( final Connection c, final AuthenticationCriteria criteria) throws LdapException { final byte[] hash = digestCredential(criteria.getCredential(), passwordScheme.getAlgorithm()); final LdapAttribute la = new LdapAttribute( passwordAttribute, String.format("{%s}%s", passwordScheme.getLabel(), LdapUtils.base64Encode(hash)).getBytes()); final CompareOperation compare = new CompareOperation(c); final CompareRequest request = new CompareRequest(criteria.getDn(), la); request.setControls(processRequestControls(criteria)); final Response<Boolean> compareResponse = compare.execute(request); return new AuthenticationHandlerResponse( compareResponse.getResult(), compareResponse.getResultCode(), c, compareResponse.getMessage(), compareResponse.getControls(), compareResponse.getMessageId()); }
@Override protected AuthenticationHandlerResponse authenticateInternal( final Connection c, final AuthenticationCriteria criteria) throws LdapException { final byte[] hash = digestCredential(criteria.getCredential(), passwordScheme.getAlgorithm()); final LdapAttribute la = new LdapAttribute( passwordAttribute, String.format("{%s}%s", passwordScheme.getLabel(), LdapUtils.base64Encode(hash)).getBytes()); final CompareOperation compare = new CompareOperation(c); final CompareRequest request = new CompareRequest(criteria.getDn(), la); request.setControls(processRequestControls(criteria)); final Response<Boolean> compareResponse = compare.execute(request); return new AuthenticationHandlerResponse( compareResponse.getResult(), compareResponse.getResultCode(), c, compareResponse.getMessage(), compareResponse.getControls(), compareResponse.getMessageId()); }