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

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

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

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

/**
 * Authenticate the bound connection using the supplied credentials.
 *
 * @return For an {@link #getAuthenticationMode()} of {@link Mode#BEFORE_CONNECT} the return value is
 * always {@code true} otherwise the return value is {@code true} if and only if authentication was
 * successful.
 */
public final boolean authenticate(TaskListener listener) {
  setListener(listener);
  return authenticate();
}
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-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

      && 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.sshcredentialsSSHAuthenticatorauthenticate

Popular methods of SSHAuthenticator

  • matcher
    Creates a CredentialsMatcher for the specific type of connection.
  • newInstance
    Creates an authenticator that may be able to authenticate the supplied connection with the supplied
  • 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
  • getSupportFragmentManager (FragmentActivity)
  • requestLocationUpdates (LocationManager)
  • onCreateOptionsMenu (Activity)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JList (javax.swing)
  • 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