migueldeicaza / SwiftTermApp

MIT License
305 stars 29 forks source link

Login sequence #94

Closed migueldeicaza closed 2 years ago

migueldeicaza commented 2 years ago

The current login sequence forces the configured option to be used, we should instead iterate over the options until no options are working.

What we should do in authenticate is prioritize the most convenient key, based on what the server sent, and this might be different depending on the mode of operation.

For interactive use:

  1. Public-key that has been linked to the session: this is ideal, and prevents many roundtrips, so we can try that first, if it is set, whether this is a secure enclave key, a private key with a passphrase, a public key without passphrase or a password.
  2. If not set we attempt public keys in order, until we run out of public keys, or the server no longer wants to use public key authentication.
  3. Attempt to use the password authentication

For batch use:

The topic to consider is whether the secure enclave should be used during batch mode - my initial feeling is yes. The secondary issue is whether to prompt for a password in that mode, and I suspect this also has to be the case, if it is the fallback.

Also:

migueldeicaza commented 2 years ago

I think this is done as of a night or two ago