@Override
    public Service resolveServiceFrom(final Service service) {
        val replyParamRes = getReplyAsParameter(service);
        if (replyParamRes.isPresent()) {
            val serviceReply = replyParamRes.get().getValue();
            LOGGER.trace("Located service id [{}] from service authentication request at [{}]", serviceReply, service.getId());
            return createService(serviceReply, service);
        }
        LOGGER.trace("Resolved final service as [{}]", service);
        return service;
    }
This is {@link WSFederationAuthenticationServiceSelectionStrategy}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-ws-sts-api/src/main/java/org/apereo/cas/authentication/WSFederationAuthenticationServiceSelectionStrategy.java