protected boolean ensureTokenIsValid(final OAuth20Token token) {
        val validStatefulTicket = !token.isStateless() && token.isCode()
            && getConfigurationContext().getObject().getTicketRegistry().getTicket(token.getTicketGrantingTicket().getId()) != null;
        return validStatefulTicket || (token.isStateless() && token.getAuthentication() != null && !token.isExpired());
    }
This is {@link AccessTokenAuthorizationCodeGrantRequestExtractor}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/response/accesstoken/ext/AccessTokenAuthorizationCodeGrantRequestExtractor.java