protected static Authentication resolveAuthenticationFrom(final OAuth20Code oauthCode) {
        return oauthCode.isStateless()
            ? oauthCode.getAuthentication()
            : ((AuthenticationAwareTicket) oauthCode.getTicketGrantingTicket()).getAuthentication();
    }
This is {@link BaseOAuth20TokenRequestValidator}.

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