Tabnine Logo
HttpAuthUtils$HttpKerberosClientAction.<init>
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using org.apache.hive.service.auth.HttpAuthUtils$HttpKerberosClientAction.<init> (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.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: 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.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: 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<init>

Popular methods of HttpAuthUtils$HttpKerberosClientAction

    Popular in Java

    • Running tasks concurrently on multiple threads
    • getContentResolver (Context)
    • setRequestProperty (URLConnection)
    • onCreateOptionsMenu (Activity)
    • FlowLayout (java.awt)
      A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
    • BufferedImage (java.awt.image)
      The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
    • String (java.lang)
    • TreeSet (java.util)
      TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
    • Base64 (org.apache.commons.codec.binary)
      Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
    • Scheduler (org.quartz)
      This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
    • Top Sublime Text plugins
    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