congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
JaasKrbUtil
Code IndexAdd Tabnine to your IDE (free)

How to use
JaasKrbUtil
in
org.apache.kerby.kerberos.kerb.client

Best Java code snippets using org.apache.kerby.kerberos.kerb.client.JaasKrbUtil (Showing top 14 results out of 315)

origin: apache/hbase

private CloseableHttpClient createHttpClient() throws Exception {
 final Subject clientSubject = JaasKrbUtil.loginUsingKeytab(clientPrincipal, clientKeytab);
 final Set<Principal> clientPrincipals = clientSubject.getPrincipals();
origin: org.apache.kerby/kerb-simplekdc

public static Subject loginUsingKeytab(
    String principal, File keytabFile) throws LoginException {
  Set<Principal> principals = new HashSet<>();
  principals.add(new KerberosPrincipal(principal));
  Subject subject = new Subject(false, principals,
      new HashSet<Object>(), new HashSet<Object>());
  Configuration conf = useKeytab(principal, keytabFile);
  String confName = "KeytabConf";
  LoginContext loginContext = new LoginContext(confName, subject, null, conf);
  loginContext.login();
  return loginContext.getSubject();
}
origin: org.apache.kerby/kerb-simplekdc

public static Subject loginUsingTicketCache(
    String principal, File cacheFile) throws LoginException {
  Set<Principal> principals = new HashSet<>();
  principals.add(new KerberosPrincipal(principal));
  Subject subject = new Subject(false, principals,
      new HashSet<Object>(), new HashSet<Object>());
  Configuration conf = useTicketCache(principal, cacheFile);
  String confName = "TicketCacheConf";
  LoginContext loginContext = new LoginContext(confName, subject, null, conf);
  loginContext.login();
  return loginContext.getSubject();
}
origin: org.apache.kerby/kerb-simplekdc

public static Subject loginUsingPassword(
    String principal, String password) throws LoginException {
  Set<Principal> principals = new HashSet<>();
  principals.add(new KerberosPrincipal(principal));
  Subject subject = new Subject(false, principals,
      new HashSet<Object>(), new HashSet<Object>());
  Configuration conf = usePassword(principal);
  String confName = "PasswordConf";
  CallbackHandler callback = new KrbCallbackHandler(principal, password);
  LoginContext loginContext = new LoginContext(confName, subject, callback, conf);
  loginContext.login();
  return loginContext.getSubject();
}
origin: apache/directory-kerby

protected Subject loginClientUsingPassword() throws LoginException {
  return JaasKrbUtil.loginUsingPassword(getClientPrincipal(),
    getClientPassword());
}
origin: apache/directory-kerby

protected Subject loginClientUsingTicketCache() throws Exception {
  TgtTicket tgt = getKrbClient().requestTgt(getClientPrincipal(),
    getClientPassword());
  getKrbClient().storeTicket(tgt, ticketCacheFile);
  return JaasKrbUtil.loginUsingTicketCache(getClientPrincipal(),
    ticketCacheFile);
}
origin: apache/directory-kerby

public static Subject loginUsingKeytab(
    String principal, File keytabFile) throws LoginException {
  Set<Principal> principals = new HashSet<>();
  principals.add(new KerberosPrincipal(principal));
  Subject subject = new Subject(false, principals,
      new HashSet<Object>(), new HashSet<Object>());
  Configuration conf = useKeytab(principal, keytabFile);
  String confName = "KeytabConf";
  LoginContext loginContext = new LoginContext(confName, subject, null, conf);
  loginContext.login();
  return loginContext.getSubject();
}
origin: apache/directory-kerby

public static Subject loginUsingTicketCache(
    String principal, File cacheFile) throws LoginException {
  Set<Principal> principals = new HashSet<>();
  principals.add(new KerberosPrincipal(principal));
  Subject subject = new Subject(false, principals,
      new HashSet<Object>(), new HashSet<Object>());
  Configuration conf = useTicketCache(principal, cacheFile);
  String confName = "TicketCacheConf";
  LoginContext loginContext = new LoginContext(confName, subject, null, conf);
  loginContext.login();
  return loginContext.getSubject();
}
origin: apache/directory-kerby

public static Subject loginUsingPassword(
    String principal, String password) throws LoginException {
  Set<Principal> principals = new HashSet<>();
  principals.add(new KerberosPrincipal(principal));
  Subject subject = new Subject(false, principals,
      new HashSet<Object>(), new HashSet<Object>());
  Configuration conf = usePassword(principal);
  String confName = "PasswordConf";
  CallbackHandler callback = new KrbCallbackHandler(principal, password);
  LoginContext loginContext = new LoginContext(confName, subject, callback, conf);
  loginContext.login();
  return loginContext.getSubject();
}
origin: apache/hbase

@Test
public void testAllowedClient() throws Exception {
 final Subject clientSubject = JaasKrbUtil.loginUsingKeytab(CLIENT_PRINCIPAL, clientKeytab);
 final Set<Principal> clientPrincipals = clientSubject.getPrincipals();
origin: org.apache.kerby/has-tool

  @Override
  public void run() {
    Subject subject = null;
    try {
      subject = JaasKrbUtil.loginUsingKeytab(principalList.get(index),
        keytabList.get(index));
    } catch (LoginException e) {
      System.err.println("Failed to login using keytab. " + e);
    }
    if (subject != null) {
      System.out.println("Login succeeded for user: "
        + subject.getPrincipals().iterator().next());
    }
  }
}
origin: apache/directory-kerby

  @Override
  public void run() {
    Subject subject = null;
    try {
      subject = JaasKrbUtil.loginUsingKeytab(principalList.get(index),
        keytabList.get(index));
    } catch (LoginException e) {
      System.err.println("Failed to login using keytab. " + e);
    }
    if (subject != null) {
      System.out.println("Login succeeded for user: "
        + subject.getPrincipals().iterator().next());
    }
  }
}
origin: org.apache.hbase/hbase-thrift

private CloseableHttpClient createHttpClient() throws Exception {
 final Subject clientSubject = JaasKrbUtil.loginUsingKeytab(clientPrincipal, clientKeytab);
 final Set<Principal> clientPrincipals = clientSubject.getPrincipals();
origin: apache/directory-kerby

protected Subject loginServiceUsingKeytab() throws Exception {
  getKdcServer().exportPrincipal(getServerPrincipal(), serviceKeytabFile);
  return JaasKrbUtil.loginUsingKeytab(getServerPrincipal(),
    serviceKeytabFile);
}
org.apache.kerby.kerberos.kerb.clientJaasKrbUtil

Javadoc

JAAS utilities for Kerberos login.

Most used methods

  • loginUsingKeytab
  • loginUsingPassword
  • loginUsingTicketCache
  • useKeytab
  • usePassword
  • useTicketCache

Popular in Java

  • Creating JSON documents from java classes using gson
  • getExternalFilesDir (Context)
  • setRequestProperty (URLConnection)
  • setContentView (Activity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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