public static String buildPlain(final JWTClaimsSet claimsSet,
                                    final Optional<RegisteredService> registeredService) {
        val header = new PlainHeader.Builder().type(JOSEObjectType.JWT);
        registeredService.ifPresent(svc ->
            header.customParam(RegisteredServiceCipherExecutor.CUSTOM_HEADER_REGISTERED_SERVICE_ID, svc.getId()));
        return new PlainJWT(header.build(), claimsSet).serialize();
    }
Build plain string.

@param claimsSet         the claims set
@param registeredService the registered service
@return the jwt
support/cas-server-support-token-core-api/src/main/java/org/apereo/cas/token/JwtBuilder.java