class PasswordCredentialsRequestValidatorImpl implements PasswordCredentialsRequestValidator {

    public void validateRequest(OAuth2Request request, ClientRegistration clientRegistration) {
        Reject.ifTrue(Utils.isEmpty(request.<String>getParameter("username")), "Missing parameter, 'username'");
        Reject.ifTrue(Utils.isEmpty(request.<String>getParameter("password")), "Missing parameter, 'password'");
    }

}