OAuth2: Store 'Account::davUser' in the config, and use that user for connecting
authorOlivier Goffart <ogoffart@woboq.com>
Fri, 5 Oct 2018 17:45:43 +0000 (19:45 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:11 +0000 (10:58 +0100)
commit15eab07866d5feb179e25125673dce51c1dda4fa
treea638cf5327ca8bdc9822400e4ac4f5db659183a5
parent75f66ddaa16f9d816c3b37dfa4ba9e36f6b78c0d
OAuth2: Store 'Account::davUser' in the config, and use that user for connecting

We need to use the user id to check if we are connected to the right account.
These might be different from the HTTP Basic Auth login. (LDAP setups)

When the account was configured as an oauth2 account form the wisard, the
http_user was already set correctly to the user id. But when the server is
upgrading from basic auth to oauth2, we need to pick the right login.

Note that Account::davUser() already defaults to the HTTP user when none
is set, so this means the upgrade will be fine if this is not set in the
config.

Issues:
https://github.com/owncloud/oauth2/issues/109
https://github.com/owncloud/enterprise/issues/2781
src/gui/accountmanager.cpp
src/gui/creds/httpcredentialsgui.cpp
src/libsync/account.cpp