@Override
    public List<Credential> fromRequest(final HttpServletRequest request, final MultiValueMap<String, String> requestBody) throws Throwable {
        if (requestBody == null || requestBody.isEmpty()) {
            LOGGER.debug("Skipping [{}] because the requestBody is null or empty", getClass().getSimpleName());
            return new ArrayList<>();
        }
        val username = requestBody.getFirst(RestHttpRequestCredentialFactory.PARAMETER_USERNAME);
        val password = requestBody.getFirst(RestHttpRequestCredentialFactory.PARAMETER_PASSWORD);
        val rememberMe = requestBody.getFirst(RememberMeCredential.REQUEST_PARAMETER_REMEMBER_ME);
        if (StringUtils.isBlank(username) || StringUtils.isBlank(password)) {
            LOGGER.debug("Invalid payload; missing required fields.");
            return new ArrayList<>();
        }
        val credential = new RememberMeUsernamePasswordCredential(BooleanUtils.toBoolean(rememberMe));
        credential.setUsername(username);
        credential.assignPassword(password);
        prepareCredential(request, credential);
        return CollectionUtils.wrap(credential);
    }
This is {@link UsernamePasswordRestHttpRequestCredentialFactory}.

@author Misagh Moayyed
@since 5.0.0
core/cas-server-core-rest-api/src/main/java/org/apereo/cas/rest/factory/UsernamePasswordRestHttpRequestCredentialFactory.java