@Override
    public List<Credential> fromAuthentication(final HttpServletRequest request,
                                               final MultiValueMap<String, String> requestBody,
                                               final Authentication authentication,
                                               final MultifactorAuthenticationProvider provider) {
        return this.chain
            .stream()
            .sorted(Comparator.comparing(RestHttpRequestCredentialFactory::getOrder))
            .map(f -> f.fromAuthentication(request, requestBody, authentication, provider))
            .flatMap(List::stream)
            .collect(Collectors.toList());
    }
Add credential factory.

@param factory the factory
core/cas-server-core-rest-api/src/main/java/org/apereo/cas/rest/factory/ChainingRestHttpRequestCredentialFactory.java