protected void handleVerification(VerifyPasswordCallback vpc) throws LoginException { String userPass = vpc.getValue(); String passwordFromDB = getPassword(); if(userPass.equals(passwordFromDB)) { vpc.setVerified(true); } else { throw new LoginException(PicketBoxMessages.MESSAGES.authenticationFailedMessage()); } }
protected void verifyPassword( VerifyPasswordCallback vpc) throws NamingException { String credential = vpc.getValue(); ClassLoader currentTCCL = SecurityActions.getContextClassLoader(); if (currentTCCL != null) SecurityActions.setContextClassLoader(null); String baseDN = options.get(BASE_CTX_DN); String baseFilter = options.get(BASE_FILTER_OPT); InitialLdapContext ctx= this.constructInitialLdapContext(bindDN, bindCredential); bindDNAuthentication(ctx, userName, credential, baseDN, baseFilter); vpc.setVerified(true); }