@Override
	protected void additionalAuthenticationChecks(UserDetails userDetails,
			UsernamePasswordAuthenticationToken authentication) {

		Authentication authentication2 = SecurityContextHolder.getContext().getAuthentication();
		if (authentication2 != null) {
			return;
		}

		String message = messages.getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials",
				"Bad credentials");
		if (authentication.getCredentials() == null) {
			LOG.debug("Authentication failed: no credentials provided");
			throw new BadCredentialsException(message);
		}

		String presentedPassword = authentication.getCredentials().toString();
		SecuredUser user = ((SecuredUser) userDetails);
		boolean authorized = false;

		for (OnLoginRunnable each : getPluginManager().getEnabledModulesByClass(OnLoginRunnable.class, asList(defaultLdapLoginPlugin, defaultLoginPlugin))) {
			if (each.getClass().getName().equals(user.getAuthProviderClass())) {
				authorized = each.validateUser(user.getUsername(), presentedPassword, user.getPassword(), passwordEncoder, user.getUsername());
				break;
			}
		}

		if (!authorized) {
			LOG.info("{} is not logined by {}", user.getUsername(), user.getAuthProviderClass());
			throw new BadCredentialsException(message);
		}
		LOG.info("{} is logined by {}", user.getUsername(), user.getAuthProviderClass());

		// If It's the first time to login
		if (user.getUser().getId() == null) {
			addNewUserIntoLocal(user);
			LOG.info("{} is saved by password {}", user.getUser().getUserId(), user.getUser().getPassword());
		} else {
			// update user information without followers
			userService.saveWithoutFollowers(user.getUser());
		}
	}
nGrinder UserDetailsAuthenticationProvider.

This class validates the user provided ID / Password from login page. Internally it uses the plugins implementing
{@link OnLoginRunnable}. If you want to extend user authentification, please create the plugin implementing
{@link OnLoginRunnable} interface.

@since 3.0
ngrinder-controller/src/main/java/org/ngrinder/security/NGrinderAuthenticationProvider.java