private void View_ChangedUsernameEvent() { _credentials.setUsername(_view.Username); if (Utils.IsNotBlank(_credentials.getUsername())) { String password = KeychainFactory.instance().getPassword(_protocol.getScheme(), _protocol.getDefaultPort(), _protocol.getDefaultHostname(), _credentials.getUsername()); if (Utils.IsNotBlank(password)) { _view.Password = password; } } Update(); }
public void ReadPasswordFromKeychain() { if (Preferences.instance().getBoolean("connection.login.useKeychain")) { if (string.IsNullOrEmpty(View.Hostname)) { return; } if (string.IsNullOrEmpty(View.Port)) { return; } if (string.IsNullOrEmpty(View.Username)) { return; } Protocol protocol = View.SelectedProtocol; View.Password = KeychainFactory.instance().getPassword(protocol.getScheme(), Integer.parseInt(View.Port), View.Hostname, View.Username); } }
public static void Register() { KeychainFactory.addFactory(ch.cyberduck.core.Factory.NATIVE_PLATFORM, new Factory()); }