예제 #1
0
 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();
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
 public static void Register()
 {
     KeychainFactory.addFactory(ch.cyberduck.core.Factory.NATIVE_PLATFORM, new Factory());
 }