log.info(String.format("Fetching private key passphrase from keychain for %s", bookmark)); if(credentials.isPublicKeyAuthentication()) { final Local key = credentials.getIdentity(); String passphrase = this.getPassword(bookmark.getHostname(), key.getAbbreviatedPath());
if(credentials.isPublicKeyAuthentication()) {
if(credentials.isPublicKeyAuthentication()) { keychain.addPassword(bookmark.getHostname(), credentials.getIdentity().getAbbreviatedPath(), credentials.getPassword());
@Override public void open(final Host host, final Path workdir) throws AccessDeniedException { final boolean identity = host.getCredentials().isPublicKeyAuthentication(); final Application application = finder.getDescription(preferences.getProperty("terminal.bundle.identifier"));
if(!credentials.isPublicKeyAuthentication()) { if(null != entry.getIdentityFile()) { if(log.isInfoEnabled()) {
if(credentials.isPublicKeyAuthentication()) { if(!credentials.getIdentity().attributes().getPermission().isReadable()) { log.warn(String.format("Prompt to select identity file not readable %s", credentials.getIdentity()));
log.debug(String.format("Login using public key authentication with credentials %s", credentials)); if(credentials.isPublicKeyAuthentication()) { final Local identity = credentials.getIdentity(); final FileKeyProvider provider;
log.info(String.format("Add password for bookmark %s", bookmark)); if(credentials.isPublicKeyAuthentication()) { this.addPassword(bookmark.getHostname(), credentials.getIdentity().getAbbreviatedPath(), credentials.getIdentityPassphrase());
if(input.isPublicKeyAuthentication()) { bookmark.getCredentials().setIdentity(input.getIdentity()); publickey.set(true);
@Override public void change(final Host bookmark) { privateKeyPopup.setEnabled(options.publickey); if(credentials.isPublicKeyAuthentication()) { privateKeyPopup.selectItemAtIndex(privateKeyPopup.indexOfItemWithRepresentedObject(credentials.getIdentity().getAbsolute())); } else { privateKeyPopup.selectItemWithTitle(LocaleFactory.localizedString("None")); } if(credentials.isPublicKeyAuthentication()) { final Local key = credentials.getIdentity(); if(-1 == privateKeyPopup.indexOfItemWithRepresentedObject(key.getAbsolute()).intValue()) { final NSInteger index = new NSInteger(0); privateKeyPopup.insertItemWithTitle_atIndex(key.getAbbreviatedPath(), index); privateKeyPopup.itemAtIndex(index).setRepresentedObject(key.getAbsolute()); } } } });
@Override public Boolean authenticate(final Host bookmark, final LoginCallback callback, final CancelCallback cancel) throws BackgroundException { final Credentials credentials = bookmark.getCredentials(); if(StringUtils.isBlank(credentials.getPassword())) { final Credentials input = callback.prompt(bookmark, credentials.getUsername(), String.format("%s %s", LocaleFactory.localizedString("Login", "Login"), bookmark.getHostname()), MessageFormat.format(LocaleFactory.localizedString( "Login {0} with username and password", "Credentials"), BookmarkNameProvider.toString(bookmark)), // Change of username or service not allowed new LoginOptions(bookmark.getProtocol()).user(false)); if(input.isPublicKeyAuthentication()) { credentials.setIdentity(input.getIdentity()); return new SFTPPublicKeyAuthentication(session).authenticate(bookmark, callback, cancel); } credentials.setSaved(input.isSaved()); credentials.setPassword(input.getPassword()); } return this.authenticate(bookmark, credentials, callback, cancel); }
credentials.setPassword(input.getPassword()); credentials.setSaved(input.isSaved()); if(input.isPublicKeyAuthentication()) { credentials.setIdentity(input.getIdentity());
@Override public void login(final Proxy proxy, final LoginCallback prompt, final CancelCallback cancel) throws BackgroundException { try { config.setMantaUser(host.getCredentials().getUsername()); if(host.getCredentials().isPublicKeyAuthentication()) { config.setMantaKeyId(new MantaPublicKeyAuthentication(this).authenticate(host, prompt, cancel)); } else { config.setPassword(host.getCredentials().getPassword()); } config.setNoAuth(false); config.reload(); // Instantiation of client does not validate credentials. List the home path to test the connection client.isDirectoryEmpty(new MantaHomeFinderFeature(this).find().getAbsolute()); } catch(ConfigurationException e) { throw new BackgroundException(e.getRawMessage(), e); } catch(MantaException e) { throw new MantaExceptionMappingService().map(e); } catch(MantaClientHttpResponseException e) { throw new MantaHttpExceptionMappingService().map(e); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map(e); } }