@Bean
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    public TicketSerializationExecutionPlanConfigurer oauthTicketSerializationExecutionPlanConfigurer(final ConfigurableApplicationContext applicationContext) {
        return plan -> {
            plan.registerTicketSerializer(new OAuthCodeTicketStringSerializer(applicationContext));
            plan.registerTicketSerializer(new AccessTokenTicketStringSerializer(applicationContext));
            plan.registerTicketSerializer(new RefreshTokenTicketStringSerializer(applicationContext));
            plan.registerTicketSerializer(new DeviceTokenTicketStringSerializer(applicationContext));
            plan.registerTicketSerializer(new DeviceUserCodeTicketStringSerializer(applicationContext));

            plan.registerTicketSerializer(OAuth20Code.class.getName(), new OAuthCodeTicketStringSerializer(applicationContext));
            plan.registerTicketSerializer(OAuth20AccessToken.class.getName(), new AccessTokenTicketStringSerializer(applicationContext));
            plan.registerTicketSerializer(OAuth20RefreshToken.class.getName(), new RefreshTokenTicketStringSerializer(applicationContext));
            plan.registerTicketSerializer(OAuth20DeviceToken.class.getName(), new DeviceTokenTicketStringSerializer(applicationContext));
            plan.registerTicketSerializer(OAuth20DeviceUserCode.class.getName(), new DeviceUserCodeTicketStringSerializer(applicationContext));

            plan.registerTicketSerializer(OAuth20Code.PREFIX, new OAuthCodeTicketStringSerializer(applicationContext));
            plan.registerTicketSerializer(OAuth20AccessToken.PREFIX, new AccessTokenTicketStringSerializer(applicationContext));
            plan.registerTicketSerializer(OAuth20RefreshToken.PREFIX, new RefreshTokenTicketStringSerializer(applicationContext));
            plan.registerTicketSerializer(OAuth20DeviceToken.PREFIX, new DeviceTokenTicketStringSerializer(applicationContext));
            plan.registerTicketSerializer(OAuth20DeviceUserCode.PREFIX, new DeviceUserCodeTicketStringSerializer(applicationContext));
        };
    }
This is {@link CasOAuth20TicketSerializationConfiguration}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-oauth/src/main/java/org/apereo/cas/config/CasOAuth20TicketSerializationConfiguration.java