code: public static final String produceToken(String principal, Set<String> roles, int expiresInMillis) {
          AuthToken authToken = createAuthToken(principal, roles, expiresInMillis);
          String json = toJSON(authToken);
          return StringUtils.newStringUtf8(Base64.encodeBase64(StringUtils.getBytesUtf8(json)));
      }
docs: Produce a token suitable for transmission.  This will generate the auth token,
  then serialize it to a JSON string, then Base64 encode the JSON.
  @param principal the auth principal
  @param roles the auth roles
  @param expiresInMillis the number of millis to expiry
  @return the token