public static String encodeUrlSafeBase64(final String data) {
        return Base64.encodeBase64URLSafeString(data.getBytes(StandardCharsets.UTF_8));
    }
Encode url safe base64 string.

@param data the data
@return the string
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/EncodingUtils.java