Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support JSch IdentityRepository for authentication #81

Open
cfieber opened this issue Jan 6, 2017 · 0 comments
Open

Support JSch IdentityRepository for authentication #81

cfieber opened this issue Jan 6, 2017 · 0 comments

Comments

@cfieber
Copy link

cfieber commented Jan 6, 2017

This allows use of jsch-agent-proxy to pull identities from ssh-agent.

As a workaround, the below example works, but feels pretty brittle for two reason:

  1. taking advantage of Groovy letting me ignore the private modifier on engine.jsch
  2. passing defaultPassword: '' because the connect() method expects either a password or a keyFile
def identityRepository = new RemoteIdentityRepository(ConnectorFactory.default.createConnector())
def engine = new SshDslEngine(new SshOptions(defaultPassword: '', jschProperties: [(SshDslEngine.SSH_PREFERRED_AUTHENTICATIONS): 'publickey']))
    engine.jsch.setIdentityRepository(identityRepository)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant