code: private String getBearerToken(HttpConnectionInterceptorContext context) {
          final AtomicReference<String> iamTokenResponse = new AtomicReference<String>();
          boolean result = super.requestCookie(context, iamServerUrl, iamTokenRequestBody,
                  "application/x-www-form-urlencoded", "application/json",
                  new StoreBearerCallable(iamTokenResponse));
          if (result) {
              return iamTokenResponse.get();
          } else {
              return null;
          }
      }
docs: get bearer token returned by IAM in JSON format