@Override
    public Service restore(final RequestContext requestContext,
                           final WebContext webContext,
                           final Optional<TransientSessionTicket> givenSessionTicket,
                           final Client client) {
        return givenSessionTicket
            .map(ticket -> {
                val service = ticket.getService();
                LOGGER.trace("Restoring requested service [{}] back in the authentication flow", service);
                WebUtils.putServiceIntoFlowScope(requestContext, service);
                webContext.setRequestAttribute(CasWebflowConstants.ATTRIBUTE_SERVICE, service);

                val themeParamName = configContext.getCasProperties().getTheme().getParamName();
                val localParamName = configContext.getCasProperties().getLocale().getParamName();

                val properties = ticket.getProperties();
                webContext.setRequestAttribute(themeParamName, properties.get(themeParamName));

                val localeValue = properties.get(localParamName);
                Optional.ofNullable(localeValue)
                    .ifPresent(locale -> {
                        webContext.setRequestAttribute(localParamName, locale);
                        val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);
                        val response = WebUtils.getHttpServletResponseFromExternalWebflowContext(requestContext);
                        Optional.ofNullable(RequestContextUtils.getLocaleResolver(request))
                            .ifPresent(localeResolver -> localeResolver.setLocale(request, response, Locale.forLanguageTag(locale.toString())));
                    });
                webContext.setRequestAttribute(CasProtocolConstants.PARAMETER_METHOD, properties.get(CasProtocolConstants.PARAMETER_METHOD));
                return service;
            })
            .orElse(null);
    }
Build the ticket properties.

@param webContext the web context
@return the ticket properties
support/cas-server-support-pac4j-core/src/main/java/org/apereo/cas/web/flow/DefaultDelegatedClientAuthenticationWebflowStateContributor.java