class SpringSecurityPasswordValidationCallbackHandler extends AbstractWsPasswordCallbackHandler implements InitializingBean {

	protected void handleUsernameToken(WSPasswordCallback callback) throws IOException, UnsupportedCallbackException {
		UserDetails user = loadUserDetails(callback.getIdentifier());
		if (user != null) {
			SpringSecurityUtils.checkUserValidity(user);
			callback.setPassword(user.getPassword());
		}
	}

}