congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
GSSCallbackHandler.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.postgresql.gss.GSSCallbackHandler
constructor

Best Java code snippets using org.postgresql.gss.GSSCallbackHandler.<init> (Showing top 4 results out of 315)

origin: org.postgresql/postgresql

  new LoginContext(jaasApplicationName, new GSSCallbackHandler(user, password));
lc.login();
sub = lc.getSubject();
origin: postgresql/postgresql

public static void authenticate(PGStream pgStream, String host, String user, String password, String jaasApplicationName, String kerberosServerName, Logger logger) throws IOException, SQLException
{
  if (logger.logDebug())
    logger.debug(" <=BE AuthenticationReqGSS");
  Object result = null;
  if (jaasApplicationName == null)
    jaasApplicationName = "pgjdbc";
  if (kerberosServerName == null)
    kerberosServerName = "postgres";
  try {
    LoginContext lc = new LoginContext(jaasApplicationName, new GSSCallbackHandler(user, password));
    lc.login();
    Subject sub = lc.getSubject();
    PrivilegedAction action = new GssAction(pgStream, host, user, password, kerberosServerName, logger);
    result = Subject.doAs(sub, action);
  } catch (Exception e) {
    throw new PSQLException(GT.tr("GSS Authentication failed"), PSQLState.CONNECTION_FAILURE, e);
  }
  if (result instanceof IOException)
    throw (IOException)result;
  else if (result instanceof SQLException)
    throw (SQLException)result;
  else if (result != null)
    throw new PSQLException(GT.tr("GSS Authentication failed"), PSQLState.CONNECTION_FAILURE, (Exception)result);
}
origin: org.ancoron.postgresql/org.postgresql.osgi

public static void authenticate(PGStream pgStream, String host, String user, String password, String jaasApplicationName, String kerberosServerName, Logger logger) throws IOException, SQLException
{
  if (logger.logDebug())
    logger.debug(" <=BE AuthenticationReqGSS");
  Object result = null;
  if (jaasApplicationName == null)
    jaasApplicationName = "pgjdbc";
  if (kerberosServerName == null)
    kerberosServerName = "postgres";
  try {
    LoginContext lc = new LoginContext(jaasApplicationName, new GSSCallbackHandler(user, password));
    lc.login();
    Subject sub = lc.getSubject();
    PrivilegedAction action = new GssAction(pgStream, host, user, password, kerberosServerName, logger);
    result = Subject.doAs(sub, action);
  } catch (Exception e) {
    throw new PSQLException(GT.tr("GSS Authentication failed"), PSQLState.CONNECTION_FAILURE, e);
  }
  if (result instanceof IOException)
    throw (IOException)result;
  else if (result instanceof SQLException)
    throw (SQLException)result;
  else if (result != null)
    throw new PSQLException(GT.tr("GSS Authentication failed"), PSQLState.CONNECTION_FAILURE, (Exception)result);
}
origin: org.ancoron.postgresql/org.postgresql

public static void authenticate(PGStream pgStream, String host, String user, String password, String jaasApplicationName, String kerberosServerName, Logger logger) throws IOException, SQLException
{
  if (logger.logDebug())
    logger.debug(" <=BE AuthenticationReqGSS");
  Object result = null;
  if (jaasApplicationName == null)
    jaasApplicationName = "pgjdbc";
  if (kerberosServerName == null)
    kerberosServerName = "postgres";
  try {
    LoginContext lc = new LoginContext(jaasApplicationName, new GSSCallbackHandler(user, password));
    lc.login();
    Subject sub = lc.getSubject();
    PrivilegedAction action = new GssAction(pgStream, host, user, password, kerberosServerName, logger);
    result = Subject.doAs(sub, action);
  } catch (Exception e) {
    throw new PSQLException(GT.tr("GSS Authentication failed"), PSQLState.CONNECTION_FAILURE, e);
  }
  if (result instanceof IOException)
    throw (IOException)result;
  else if (result instanceof SQLException)
    throw (SQLException)result;
  else if (result != null)
    throw new PSQLException(GT.tr("GSS Authentication failed"), PSQLState.CONNECTION_FAILURE, (Exception)result);
}
org.postgresql.gssGSSCallbackHandler<init>

Popular methods of GSSCallbackHandler

    Popular in Java

    • Running tasks concurrently on multiple threads
    • getOriginalFilename (MultipartFile)
      Return the original filename in the client's filesystem.This may contain path information depending
    • compareTo (BigDecimal)
    • getSupportFragmentManager (FragmentActivity)
    • InetAddress (java.net)
      An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
    • Selector (java.nio.channels)
      A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
    • Path (java.nio.file)
    • SortedMap (java.util)
      A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
    • JarFile (java.util.jar)
      JarFile is used to read jar entries and their associated data from jar files.
    • IOUtils (org.apache.commons.io)
      General IO stream manipulation utilities. This class provides static utility methods for input/outpu
    • Top 15 Vim 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