Tabnine Logo
SSHAuthenticator.newInstance
Code IndexAdd Tabnine to your IDE (free)

How to use
newInstance
method
in
com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator

Best Java code snippets using com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance (Showing top 6 results out of 315)

origin: org.jenkins-ci.plugins/ssh-credentials

/**
 * @deprecated Use {@link #newInstance(Object, StandardUsernameCredentials)} instead.
 */
@Deprecated
public static SSHAuthenticator<Object, StandardUsernameCredentials> newInstance(Object connection, SSHUser user)
    throws InterruptedException, IOException {
  return newInstance(connection, (StandardUsernameCredentials) user, null);
}
origin: jenkinsci/ssh-plugin

private Session createSession(final PrintStream logger) throws JSchException, IOException, InterruptedException {
  final StandardUsernameCredentials user = lookupCredentialsById(credentialId);
  if (user == null) {
    String message = "Credentials with id '" + credentialId + "', no longer exist!";
    logger.println(message);
    throw new InterruptedException(message);
  }
  final JSchConnector connector = new JSchConnector(user.getUsername(), getResolvedHostname(), port);
  final SSHAuthenticator<JSchConnector, StandardUsernameCredentials> authenticator = SSHAuthenticator
      .newInstance(connector, user);
  authenticator.authenticate(new StreamTaskListener(logger, Charset.defaultCharset()));
  final Session session = connector.getSession();
  session.setServerAliveInterval(serverAliveInterval);
  final Properties config = new Properties();
  //TODO put this as configuration option instead of ignoring by default
  config.put("StrictHostKeyChecking", "no");
  session.setConfig(config);
  session.connect(timeout);
  return session;
}
origin: org.jenkins-ci.plugins/ssh-credentials

/**
 * Creates an authenticator that may be able to authenticate the supplied connection with the supplied user.
 *
 * @param connection the connection to authenticate on.
 * @param user       the user to authenticate with.
 * @param <C>        the type of connection.
 * @param <U>        the type of user.
 * @return a {@link SSHAuthenticator} that may or may not be able to successfully authenticate.
 */
@NonNull
public static <C, U extends StandardUsernameCredentials> SSHAuthenticator<C, U> newInstance(@NonNull C connection,
                                              @NonNull U user)
    throws InterruptedException, IOException {
  return newInstance(connection, user, null);
}
origin: org.jenkins-ci.plugins/ssh-slaves

  throw new AbortException("Cannot find SSH User credentials with id: " + credentialsId);
if (SSHAuthenticator.newInstance(connection, credentials).authenticate(listener)
    && connection.isAuthenticationComplete()) {
  logger.println(Messages.SSHLauncher_AuthenticationSuccessful(getTimestamp()));
origin: jenkinsci/ssh-slaves-plugin

  throw new AbortException("Cannot find SSH User credentials with id: " + credentialsId);
if (SSHAuthenticator.newInstance(connection, credentials).authenticate(listener)
    && connection.isAuthenticationComplete()) {
  logger.println(Messages.SSHLauncher_AuthenticationSuccessful(getTimestamp()));
origin: jenkinsci/git-client-plugin

  authenticated = smart.supports(item)
      && smart.get(uri, item)
      && SSHAuthenticator.newInstance(con, item.getValue(), uri.getUser())
      .authenticate(smart.listener);
} else if (credentialsProvider instanceof CredentialsProviderImpl) {
  CredentialsProviderImpl sshcp = (CredentialsProviderImpl) credentialsProvider;
  authenticated = SSHAuthenticator.newInstance(con, sshcp.cred).authenticate(sshcp.listener);
} else {
  authenticated = false;
com.cloudbees.jenkins.plugins.sshcredentialsSSHAuthenticatornewInstance

Popular methods of SSHAuthenticator

  • matcher
    Creates a CredentialsMatcher for the specific type of connection.
  • authenticate
    Authenticate the bound connection using the supplied credentials.
  • canAuthenticate
    Returns true if the bound connection is in a state where authentication can be tried using the suppl
  • doAuthenticate
    SPI for authenticating the bound connection using the supplied credentials. As a guideline, authenti
  • getAuthenticationMode
    Returns the mode of authentication that this SSHAuthenticator supports.
  • getUser
    Gets the supplied credentials.
  • isAuthenticated
    Returns true if the bound connection has been authenticated.
  • isSupported
    Returns true if and only if the supplied connection class and user class are supported by at least o
  • lookupFactories
    This method allows a build agent to invoke #newInstance(Object,StandardUsernameCredentials,String)af
  • setListener
    Sets the TaskListener that receives errors that happen during the authentication. If you are doing t

Popular in Java

  • Finding current android device location
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • getResourceAsStream (ClassLoader)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • JFileChooser (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Github Copilot alternatives
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