@Override
    public String compact(final StringBuilder builder, final Ticket ticket) throws Exception {
        val accessToken = (OAuth20AccessToken) ticket;
        builder.append(String.format("%s%s", DELIMITER, accessToken.getService().getShortenedId()));
        builder.append(String.format("%s%s", DELIMITER, accessToken.getClientId()));
        builder.append(String.format("%s%s", DELIMITER, String.join("|", accessToken.getScopes())));
        builder.append(String.format("%s%s", DELIMITER, accessToken.getResponseType() != null ? accessToken.getResponseType().ordinal() : OAuth20ResponseTypes.CODE.ordinal()));
        builder.append(String.format("%s%s", DELIMITER, accessToken.getGrantType() != null ? accessToken.getGrantType().ordinal() : OAuth20GrantTypes.AUTHORIZATION_CODE.ordinal()));
        
        builder.append(compactAuthenticationAttempt(accessToken).toString());
        return builder.toString();
    }
This is {@link OAuth20AccessTokenCompactor}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/ticket/accesstoken/OAuth20AccessTokenCompactor.java