private String extractBearerToken(HttpServletRequest request,
      HttpServletResponse response) {
    BearerAuthExtractor extractor = new BearerAuthExtractor();
    Optional<TokenCredentials> tokenCredentials = extractor.extract(new JEEContext(
        request, response));
    return tokenCredentials.map(TokenCredentials::getToken).orElse(null);
  }
Extracts the bearer authorization header from the request. If there is no bearer
authorization token, returns null.
service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java