diff options
-rw-r--r-- | src/gui/creds/httpcredentialsgui.cpp | 11 | ||||
-rw-r--r-- | src/gui/wizard/owncloudsetuppage.cpp | 8 | ||||
-rw-r--r-- | src/libsync/networkjobs.cpp | 4 | ||||
-rw-r--r-- | src/libsync/networkjobs.h | 7 |
4 files changed, 11 insertions, 19 deletions
diff --git a/src/gui/creds/httpcredentialsgui.cpp b/src/gui/creds/httpcredentialsgui.cpp index e917f88c0..3c25c886a 100644 --- a/src/gui/creds/httpcredentialsgui.cpp +++ b/src/gui/creds/httpcredentialsgui.cpp @@ -46,15 +46,6 @@ void HttpCredentialsGui::askFromUserAsync() // First, we will check what kind of auth we need. auto job = new DetermineAuthTypeJob(_account->sharedFromThis(), this); QObject::connect(job, &DetermineAuthTypeJob::authType, this, [this](DetermineAuthTypeJob::AuthType type) { - if (type == DetermineAuthTypeJob::Unknown) { - // network error, timeout, unsupported auth type? - // This fallback exists for backwards compatibility reasons: - // in versions before 2.4 we tried basic auth when the auth type - // couldn't be determined. - qCWarning(lcHttpCredentialsGui) << "Could not determine auth type, falling back to Basic"; - type = DetermineAuthTypeJob::Basic; - } - if (type == DetermineAuthTypeJob::OAuth) { _asyncAuth.reset(new OAuth(_account, this)); _asyncAuth->_expectedUser = _user; @@ -69,7 +60,7 @@ void HttpCredentialsGui::askFromUserAsync() // We will re-enter the event loop, so better wait the next iteration QMetaObject::invokeMethod(this, "showDialog", Qt::QueuedConnection); } else { - // Unsupported auth type? Shibboleth? + // Shibboleth? qCWarning(lcHttpCredentialsGui) << "Bad http auth type:" << type; emit asked(); } diff --git a/src/gui/wizard/owncloudsetuppage.cpp b/src/gui/wizard/owncloudsetuppage.cpp index 4440fe21a..2d5725cf9 100644 --- a/src/gui/wizard/owncloudsetuppage.cpp +++ b/src/gui/wizard/owncloudsetuppage.cpp @@ -201,13 +201,15 @@ bool OwncloudSetupPage::urlHasChanged() int OwncloudSetupPage::nextId() const { - if (_authType == DetermineAuthTypeJob::Basic) { + switch (_authType) { + case DetermineAuthTypeJob::Basic: return WizardCommon::Page_HttpCreds; - } else if (_authType == DetermineAuthTypeJob::OAuth) { + case DetermineAuthTypeJob::OAuth: return WizardCommon::Page_OAuthCreds; - } else { + case DetermineAuthTypeJob::Shibboleth: return WizardCommon::Page_ShibbolethCreds; } + return WizardCommon::Page_HttpCreds; } QString OwncloudSetupPage::url() const diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp index 486634d02..f2a2ab540 100644 --- a/src/libsync/networkjobs.cpp +++ b/src/libsync/networkjobs.cpp @@ -863,8 +863,8 @@ void DetermineAuthTypeJob::start() auto authChallenge = reply->rawHeader("WWW-Authenticate").toLower(); if (authChallenge.contains("bearer ")) { _resultPropfind = OAuth; - } else if (!authChallenge.isEmpty()) { - _resultPropfind = Basic; + } else if (authChallenge.isEmpty()) { + qCWarning(lcDetermineAuthTypeJob) << "Did not receive WWW-Authenticate reply to auth-test PROPFIND"; } _propfindDone = true; checkBothDone(); diff --git a/src/libsync/networkjobs.h b/src/libsync/networkjobs.h index 7d7d68f2f..38cb9dc64 100644 --- a/src/libsync/networkjobs.h +++ b/src/libsync/networkjobs.h @@ -360,8 +360,7 @@ class OWNCLOUDSYNC_EXPORT DetermineAuthTypeJob : public QObject Q_OBJECT public: enum AuthType { - Unknown, - Basic, + Basic, // also the catch-all fallback for backwards compatibility reasons OAuth, Shibboleth }; @@ -375,8 +374,8 @@ private: void checkBothDone(); AccountPtr _account; - AuthType _resultGet = Unknown; - AuthType _resultPropfind = Unknown; + AuthType _resultGet = Basic; + AuthType _resultPropfind = Basic; bool _getDone = false; bool _propfindDone = false; }; |