Tabnine Logo
HttpAuthUtils$HttpKerberosClientAction
Code IndexAdd Tabnine to your IDE (free)

How to use
HttpAuthUtils$HttpKerberosClientAction
in
org.apache.hive.service.auth

Best Java code snippets using org.apache.hive.service.auth.HttpAuthUtils$HttpKerberosClientAction (Showing top 6 results out of 315)

origin: apache/hive

/**
 * @return Stringified Base64 encoded kerberosAuthHeader on success
 * @throws Exception
 */
public static String getKerberosServiceTicket(String principal, String host, String serverHttpUrl,
  Subject loggedInSubject) throws Exception {
 String serverPrincipal = HadoopThriftAuthBridge.getBridge().getServerPrincipal(principal, host);
 if (loggedInSubject != null) {
  return Subject.doAs(loggedInSubject, new HttpKerberosClientAction(serverPrincipal, serverHttpUrl));
 } else {
  // JAAS login from ticket cache to setup the client UserGroupInformation
  UserGroupInformation clientUGI = HadoopThriftAuthBridge.getBridge().getCurrentUGIWithConf("kerberos");
  return clientUGI.doAs(new HttpKerberosClientAction(serverPrincipal, serverHttpUrl));
 }
}
origin: org.spark-project.hive/hive-service

/**
 * @return Stringified Base64 encoded kerberosAuthHeader on success
 * @throws Exception
 */
public static String getKerberosServiceTicket(String principal, String host,
  String serverHttpUrl, boolean assumeSubject) throws Exception {
 String serverPrincipal =
   ShimLoader.getHadoopThriftAuthBridge().getServerPrincipal(principal, host);
 if (assumeSubject) {
  // With this option, we're assuming that the external application,
  // using the JDBC driver has done a JAAS kerberos login already
  AccessControlContext context = AccessController.getContext();
  Subject subject = Subject.getSubject(context);
  if (subject == null) {
   throw new Exception("The Subject is not set");
  }
  return Subject.doAs(subject, new HttpKerberosClientAction(serverPrincipal, serverHttpUrl));
 } else {
  // JAAS login from ticket cache to setup the client UserGroupInformation
  UserGroupInformation clientUGI =
    ShimLoader.getHadoopThriftAuthBridge().getCurrentUGIWithConf("kerberos");
  return clientUGI.doAs(new HttpKerberosClientAction(serverPrincipal, serverHttpUrl));
 }
}
origin: org.apache.spark/spark-hive-thriftserver

/**
 * @return Stringified Base64 encoded kerberosAuthHeader on success
 * @throws Exception
 */
public static String getKerberosServiceTicket(String principal, String host,
  String serverHttpUrl, boolean assumeSubject) throws Exception {
 String serverPrincipal =
   ShimLoader.getHadoopThriftAuthBridge().getServerPrincipal(principal, host);
 if (assumeSubject) {
  // With this option, we're assuming that the external application,
  // using the JDBC driver has done a JAAS kerberos login already
  AccessControlContext context = AccessController.getContext();
  Subject subject = Subject.getSubject(context);
  if (subject == null) {
   throw new Exception("The Subject is not set");
  }
  return Subject.doAs(subject, new HttpKerberosClientAction(serverPrincipal, serverHttpUrl));
 } else {
  // JAAS login from ticket cache to setup the client UserGroupInformation
  UserGroupInformation clientUGI =
    ShimLoader.getHadoopThriftAuthBridge().getCurrentUGIWithConf("kerberos");
  return clientUGI.doAs(new HttpKerberosClientAction(serverPrincipal, serverHttpUrl));
 }
}
origin: com.github.hyukjinkwon/hive-service

/**
 * @return Stringified Base64 encoded kerberosAuthHeader on success
 * @throws Exception
 */
public static String getKerberosServiceTicket(String principal, String host,
  String serverHttpUrl, boolean assumeSubject) throws Exception {
 String serverPrincipal =
   ShimLoader.getHadoopThriftAuthBridge().getServerPrincipal(principal, host);
 if (assumeSubject) {
  // With this option, we're assuming that the external application,
  // using the JDBC driver has done a JAAS kerberos login already
  AccessControlContext context = AccessController.getContext();
  Subject subject = Subject.getSubject(context);
  if (subject == null) {
   throw new Exception("The Subject is not set");
  }
  return Subject.doAs(subject, new HttpKerberosClientAction(serverPrincipal, serverHttpUrl));
 } else {
  // JAAS login from ticket cache to setup the client UserGroupInformation
  UserGroupInformation clientUGI =
    ShimLoader.getHadoopThriftAuthBridge().getCurrentUGIWithConf("kerberos");
  return clientUGI.doAs(new HttpKerberosClientAction(serverPrincipal, serverHttpUrl));
 }
}
origin: org.apache.spark/spark-hive-thriftserver_2.11

/**
 * @return Stringified Base64 encoded kerberosAuthHeader on success
 * @throws Exception
 */
public static String getKerberosServiceTicket(String principal, String host,
  String serverHttpUrl, boolean assumeSubject) throws Exception {
 String serverPrincipal =
   ShimLoader.getHadoopThriftAuthBridge().getServerPrincipal(principal, host);
 if (assumeSubject) {
  // With this option, we're assuming that the external application,
  // using the JDBC driver has done a JAAS kerberos login already
  AccessControlContext context = AccessController.getContext();
  Subject subject = Subject.getSubject(context);
  if (subject == null) {
   throw new Exception("The Subject is not set");
  }
  return Subject.doAs(subject, new HttpKerberosClientAction(serverPrincipal, serverHttpUrl));
 } else {
  // JAAS login from ticket cache to setup the client UserGroupInformation
  UserGroupInformation clientUGI =
    ShimLoader.getHadoopThriftAuthBridge().getCurrentUGIWithConf("kerberos");
  return clientUGI.doAs(new HttpKerberosClientAction(serverPrincipal, serverHttpUrl));
 }
}
origin: org.apache.hive/hive-service

/**
 * @return Stringified Base64 encoded kerberosAuthHeader on success
 * @throws Exception
 */
public static String getKerberosServiceTicket(String principal, String host, String serverHttpUrl,
  Subject loggedInSubject) throws Exception {
 String serverPrincipal = HadoopThriftAuthBridge.getBridge().getServerPrincipal(principal, host);
 if (loggedInSubject != null) {
  return Subject.doAs(loggedInSubject, new HttpKerberosClientAction(serverPrincipal, serverHttpUrl));
 } else {
  // JAAS login from ticket cache to setup the client UserGroupInformation
  UserGroupInformation clientUGI = HadoopThriftAuthBridge.getBridge().getCurrentUGIWithConf("kerberos");
  return clientUGI.doAs(new HttpKerberosClientAction(serverPrincipal, serverHttpUrl));
 }
}
org.apache.hive.service.authHttpAuthUtils$HttpKerberosClientAction

Javadoc

We'll create an instance of this class within a doAs block so that the client's TGT credentials can be read from the Subject

Most used methods

  • <init>

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Collectors (java.util.stream)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now