congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
GSSCallbackHandler
Code IndexAdd Tabnine to your IDE (free)

How to use
GSSCallbackHandler
in
org.postgresql.gss

Best Java code snippets using org.postgresql.gss.GSSCallbackHandler (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

Most used methods

  • <init>

Popular in Java

  • Making http post requests using okhttp
  • findViewById (Activity)
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • Menu (java.awt)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Best IntelliJ 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