@Override
    public Assertion validate(final String ticket, final String service) {
        val validationResult = FunctionUtils.doUnchecked(() -> validator.validate(ticket, service));
        val assertion = validationResult.getAssertion();

        val principalAttributes = new HashMap(validationResult.getPrincipal().getAttributes());
        principalAttributes.put(OAuth20Constants.CAS_OAUTH_STATELESS_PROPERTY, validationResult.getAssertion().isStateless());
        
        principalAttributes.putAll(assertion.getContext());
        val originalAttributes = Optional.ofNullable(assertion.getOriginalAuthentication())
            .map(Authentication::getPrincipal)
            .map(Principal::getAttributes)
            .orElseGet(HashMap::new);
        val finalAttributes = CoreAuthenticationUtils.mergeAttributes(originalAttributes, principalAttributes);
        val attrPrincipal = new AttributePrincipalImpl(validationResult.getPrincipal().getId(), finalAttributes);
        val registeredService = validationResult.getRegisteredService();

        val authenticationAttributes = authenticationAttributeReleasePolicy.getAuthenticationAttributesForRelease(
            assertion.getPrimaryAuthentication(), assertion, new HashMap<>(), registeredService);
        return new AssertionImpl(attrPrincipal, (Map) authenticationAttributes, assertion.getContext());
    }
This is {@link CASOAuth20TicketValidator}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/validator/CASOAuth20TicketValidator.java