Only attempt to use authentication methods which we have credentials for

This allows the use of, for example, password authentication on servers
that also support oauth2, depending on which credential is actually
configured.