public CasProfile validateServiceTicket(final String serviceURL, final TokenCredentials ticket, final WebContext context) {
        try {
            val assertion = configuration.retrieveTicketValidator(context).validate(ticket.getToken(), serviceURL);
            val principal = assertion.getPrincipal();
            val casProfile = new CasProfile();
            casProfile.setId(ProfileHelper.sanitizeIdentifier(principal.getName()));
            casProfile.addAttributes(principal.getAttributes());
            return casProfile;
        } catch (final TicketValidationException e) {
            throw new TechnicalException(e);
        }
    }
<p>validateServiceTicket.</p>

@param serviceURL a {@link String} object
@param ticket a {@link TokenCredentials} object
@param context a {@link WebContext} object
@return a {@link CasProfile} object
pac4j-cas/src/main/java/org/pac4j/cas/client/rest/AbstractCasRestClient.java