@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()); }
/** * Returns the password scheme. * * @return password scheme */ public String getPasswordScheme() { return passwordScheme.toString(); }
/** * Sets the password scheme. * * @param s password scheme */ public void setPasswordScheme(final String s) { passwordScheme = new Scheme(s); }
/** * Sets the password scheme. * * @param s password scheme */ public void setPasswordScheme(final String s) { passwordScheme = new Scheme(s); }
/** * Returns the password scheme. * * @return password scheme */ public String getPasswordScheme() { return passwordScheme.toString(); }