Tabnine Logo
ZKSignerSecretProvider$JaasConfiguration.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.hadoop.security.authentication.util.ZKSignerSecretProvider$JaasConfiguration
constructor

Best Java code snippets using org.apache.hadoop.security.authentication.util.ZKSignerSecretProvider$JaasConfiguration.<init> (Showing top 7 results out of 315)

origin: io.prestosql.hadoop/hadoop-apache

private String setJaasConfiguration(Properties config) throws Exception {
 String keytabFile = config.getProperty(ZOOKEEPER_KERBEROS_KEYTAB).trim();
 if (keytabFile == null || keytabFile.length() == 0) {
  throw new IllegalArgumentException(ZOOKEEPER_KERBEROS_KEYTAB
      + " must be specified");
 }
 String principal = config.getProperty(ZOOKEEPER_KERBEROS_PRINCIPAL)
     .trim();
 if (principal == null || principal.length() == 0) {
  throw new IllegalArgumentException(ZOOKEEPER_KERBEROS_PRINCIPAL
      + " must be specified");
 }
 // This is equivalent to writing a jaas.conf file and setting the system
 // property, "java.security.auth.login.config", to point to it
 JaasConfiguration jConf =
     new JaasConfiguration(JAAS_LOGIN_ENTRY_NAME, principal, keytabFile);
 Configuration.setConfiguration(jConf);
 return principal.split("[/@]")[0];
}
origin: hopshadoop/hops

private String setJaasConfiguration(Properties config) throws Exception {
 String keytabFile = config.getProperty(ZOOKEEPER_KERBEROS_KEYTAB).trim();
 if (keytabFile == null || keytabFile.length() == 0) {
  throw new IllegalArgumentException(ZOOKEEPER_KERBEROS_KEYTAB
      + " must be specified");
 }
 String principal = config.getProperty(ZOOKEEPER_KERBEROS_PRINCIPAL)
     .trim();
 if (principal == null || principal.length() == 0) {
  throw new IllegalArgumentException(ZOOKEEPER_KERBEROS_PRINCIPAL
      + " must be specified");
 }
 // This is equivalent to writing a jaas.conf file and setting the system
 // property, "java.security.auth.login.config", to point to it
 JaasConfiguration jConf =
     new JaasConfiguration(JAAS_LOGIN_ENTRY_NAME, principal, keytabFile);
 Configuration.setConfiguration(jConf);
 return principal.split("[/@]")[0];
}
origin: org.apache.hadoop/hadoop-auth

private String setJaasConfiguration(Properties config) throws Exception {
 String keytabFile = config.getProperty(ZOOKEEPER_KERBEROS_KEYTAB).trim();
 if (keytabFile == null || keytabFile.length() == 0) {
  throw new IllegalArgumentException(ZOOKEEPER_KERBEROS_KEYTAB
      + " must be specified");
 }
 String principal = config.getProperty(ZOOKEEPER_KERBEROS_PRINCIPAL)
     .trim();
 if (principal == null || principal.length() == 0) {
  throw new IllegalArgumentException(ZOOKEEPER_KERBEROS_PRINCIPAL
      + " must be specified");
 }
 // This is equivalent to writing a jaas.conf file and setting the system
 // property, "java.security.auth.login.config", to point to it
 JaasConfiguration jConf =
     new JaasConfiguration(JAAS_LOGIN_ENTRY_NAME, principal, keytabFile);
 Configuration.setConfiguration(jConf);
 return principal.split("[/@]")[0];
}
origin: hopshadoop/hops

 @Test
 public void test() throws Exception {
  String krb5LoginModuleName;
  if (System.getProperty("java.vendor").contains("IBM")) {
   krb5LoginModuleName = "com.ibm.security.auth.module.Krb5LoginModule";
  } else {
   krb5LoginModuleName = "com.sun.security.auth.module.Krb5LoginModule";
  }

  ZKSignerSecretProvider.JaasConfiguration jConf =
      new ZKSignerSecretProvider.JaasConfiguration("foo", "foo/localhost",
      "/some/location/foo.keytab");
  AppConfigurationEntry[] entries = jConf.getAppConfigurationEntry("bar");
  Assert.assertNull(entries);
  entries = jConf.getAppConfigurationEntry("foo");
  Assert.assertEquals(1, entries.length);
  AppConfigurationEntry entry = entries[0];
  Assert.assertEquals(AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,
      entry.getControlFlag());
  Assert.assertEquals(krb5LoginModuleName, entry.getLoginModuleName());
  Map<String, ?> options = entry.getOptions();
  Assert.assertEquals("/some/location/foo.keytab", options.get("keyTab"));
  Assert.assertEquals("foo/localhost", options.get("principal"));
  Assert.assertEquals("true", options.get("useKeyTab"));
  Assert.assertEquals("true", options.get("storeKey"));
  Assert.assertEquals("false", options.get("useTicketCache"));
  Assert.assertEquals("true", options.get("refreshKrb5Config"));
  Assert.assertEquals(6, options.size());
 }
}
origin: io.hops/hadoop-auth

 @Test
 public void test() throws Exception {
  String krb5LoginModuleName;
  if (System.getProperty("java.vendor").contains("IBM")) {
   krb5LoginModuleName = "com.ibm.security.auth.module.Krb5LoginModule";
  } else {
   krb5LoginModuleName = "com.sun.security.auth.module.Krb5LoginModule";
  }

  ZKSignerSecretProvider.JaasConfiguration jConf =
      new ZKSignerSecretProvider.JaasConfiguration("foo", "foo/localhost",
      "/some/location/foo.keytab");
  AppConfigurationEntry[] entries = jConf.getAppConfigurationEntry("bar");
  Assert.assertNull(entries);
  entries = jConf.getAppConfigurationEntry("foo");
  Assert.assertEquals(1, entries.length);
  AppConfigurationEntry entry = entries[0];
  Assert.assertEquals(AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,
      entry.getControlFlag());
  Assert.assertEquals(krb5LoginModuleName, entry.getLoginModuleName());
  Map<String, ?> options = entry.getOptions();
  Assert.assertEquals("/some/location/foo.keytab", options.get("keyTab"));
  Assert.assertEquals("foo/localhost", options.get("principal"));
  Assert.assertEquals("true", options.get("useKeyTab"));
  Assert.assertEquals("true", options.get("storeKey"));
  Assert.assertEquals("false", options.get("useTicketCache"));
  Assert.assertEquals("true", options.get("refreshKrb5Config"));
  Assert.assertEquals(6, options.size());
 }
}
origin: com.github.jiayuhan-it/hadoop-auth

private String setJaasConfiguration(Properties config) throws Exception {
 String keytabFile = config.getProperty(ZOOKEEPER_KERBEROS_KEYTAB).trim();
 if (keytabFile == null || keytabFile.length() == 0) {
  throw new IllegalArgumentException(ZOOKEEPER_KERBEROS_KEYTAB
      + " must be specified");
 }
 String principal = config.getProperty(ZOOKEEPER_KERBEROS_PRINCIPAL)
     .trim();
 if (principal == null || principal.length() == 0) {
  throw new IllegalArgumentException(ZOOKEEPER_KERBEROS_PRINCIPAL
      + " must be specified");
 }
 // This is equivalent to writing a jaas.conf file and setting the system
 // property, "java.security.auth.login.config", to point to it
 JaasConfiguration jConf =
     new JaasConfiguration(JAAS_LOGIN_ENTRY_NAME, principal, keytabFile);
 Configuration.setConfiguration(jConf);
 return principal.split("[/@]")[0];
}
origin: io.hops/hadoop-auth

private String setJaasConfiguration(Properties config) throws Exception {
 String keytabFile = config.getProperty(ZOOKEEPER_KERBEROS_KEYTAB).trim();
 if (keytabFile == null || keytabFile.length() == 0) {
  throw new IllegalArgumentException(ZOOKEEPER_KERBEROS_KEYTAB
      + " must be specified");
 }
 String principal = config.getProperty(ZOOKEEPER_KERBEROS_PRINCIPAL)
     .trim();
 if (principal == null || principal.length() == 0) {
  throw new IllegalArgumentException(ZOOKEEPER_KERBEROS_PRINCIPAL
      + " must be specified");
 }
 // This is equivalent to writing a jaas.conf file and setting the system
 // property, "java.security.auth.login.config", to point to it
 JaasConfiguration jConf =
     new JaasConfiguration(JAAS_LOGIN_ENTRY_NAME, principal, keytabFile);
 Configuration.setConfiguration(jConf);
 return principal.split("[/@]")[0];
}
org.apache.hadoop.security.authentication.utilZKSignerSecretProvider$JaasConfiguration<init>

Javadoc

Add an entry to the jaas configuration with the passed in name, principal, and keytab. The other necessary options will be set for you.

Popular methods of ZKSignerSecretProvider$JaasConfiguration

  • getKrb5LoginModuleName
  • getAppConfigurationEntry

Popular in Java

  • Making http post requests using okhttp
  • getSystemService (Context)
  • getApplicationContext (Context)
  • startActivity (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for WebStorm
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