protectedvoidadditionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication)throws AuthenticationException { if (authentication.getCredentials() == null) { this.logger.debug("Failed to authenticate since no credentials provided"); thrownewBadCredentialsException(this.messages.getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials")); } varuser= (User)userDetails; varpasswordType= CommonUtils.isNotEmpty(user.getPasswordType()) ? user.getPasswordType() : "noop"; varpasswordService=this.getPasswordService(passwordType); varpresentedPassword= authentication.getCredentials().toString(); if (!user.getPassword().equals(passwordService.encodePassword(presentedPassword))) { this.logger.debug("Failed to authenticate since password does not match stored value"); thrownewBadCredentialsException(this.messages.getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"));
@Override protectedvoiddoAfterPropertiesSet() { super.doAfterPropertiesSet(); Assert.notNull(this.applicationContext, "A applicationContext must be set"); }