[Pkg-owncloud-commits] [owncloud-client] 17/70: Fix regression over 1.5: Fix non-fba auth for Shib IdPs
Sandro Knauß
hefee-guest at moszumanska.debian.org
Tue Jul 1 10:21:18 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit b91967f4d9720ec134e6cbb0341000a160157906
Author: Daniel Molkentin <danimo at owncloud.com>
Date: Tue Jun 17 14:53:06 2014 +0200
Fix regression over 1.5: Fix non-fba auth for Shib IdPs
---
src/creds/shibboleth/shibbolethwebview.cpp | 19 -------------------
src/creds/shibboleth/shibbolethwebview.h | 1 -
src/creds/shibbolethcredentials.cpp | 21 +++++++++++++++++++++
src/creds/shibbolethcredentials.h | 3 +++
4 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/src/creds/shibboleth/shibbolethwebview.cpp b/src/creds/shibboleth/shibbolethwebview.cpp
index c641d22..8a9f6d9 100644
--- a/src/creds/shibboleth/shibbolethwebview.cpp
+++ b/src/creds/shibboleth/shibbolethwebview.cpp
@@ -18,10 +18,8 @@
#include <QWebFrame>
#include <QWebPage>
#include <QMessageBox>
-#include <QAuthenticator>
#include <QNetworkReply>
-#include "creds/shibboleth/authenticationdialog.h"
#include "creds/shibboleth/shibbolethwebview.h"
#include "creds/shibbolethcredentials.h"
#include "mirall/account.h"
@@ -106,23 +104,6 @@ void ShibbolethWebView::slotLoadFinished(bool success)
}
}
-void ShibbolethWebView::slotHandleAuthentication(QNetworkReply *reply, QAuthenticator *authenticator)
-{
- Q_UNUSED(reply)
- QUrl url = reply->url();
- // show only scheme, host and port
- QUrl reducedUrl;
- reducedUrl.setScheme(url.scheme());
- reducedUrl.setHost(url.host());
- reducedUrl.setPort(url.port());
-
- AuthenticationDialog dialog(authenticator->realm(), reducedUrl.toString(), this);
- if (dialog.exec() == QDialog::Accepted) {
- authenticator->setUser(dialog.user());
- authenticator->setPassword(dialog.password());
- }
-}
-
void ShibbolethWebView::accept()
{
_accepted = true;
diff --git a/src/creds/shibboleth/shibbolethwebview.h b/src/creds/shibboleth/shibbolethwebview.h
index 1999dfd..37b58c8 100644
--- a/src/creds/shibboleth/shibbolethwebview.h
+++ b/src/creds/shibboleth/shibbolethwebview.h
@@ -47,7 +47,6 @@ private Q_SLOTS:
void onNewCookiesForUrl(const QList<QNetworkCookie>& cookieList, const QUrl& url);
void slotLoadStarted();
void slotLoadFinished(bool success);
- void slotHandleAuthentication(QNetworkReply*,QAuthenticator*);
protected:
void accept();
diff --git a/src/creds/shibbolethcredentials.cpp b/src/creds/shibbolethcredentials.cpp
index 6c01efc..d9e3217 100644
--- a/src/creds/shibbolethcredentials.cpp
+++ b/src/creds/shibbolethcredentials.cpp
@@ -16,9 +16,11 @@
#include <QSettings>
#include <QNetworkReply>
#include <QMessageBox>
+#include <QAuthenticator>
#include <QDebug>
#include "creds/shibbolethcredentials.h"
+#include "creds/shibboleth/authenticationdialog.h"
#include "creds/shibboleth/shibbolethwebview.h"
#include "creds/shibboleth/shibbolethrefresher.h"
#include "creds/shibbolethcredentials.h"
@@ -154,6 +156,8 @@ QNetworkAccessManager* ShibbolethCredentials::getQNAM() const
QNetworkAccessManager* qnam(new MirallAccessManager);
connect(qnam, SIGNAL(finished(QNetworkReply*)),
this, SLOT(slotReplyFinished(QNetworkReply*)));
+ connect(qnam, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
+ SLOT(slotHandleAuthentication(QNetworkReply*,QAuthenticator*)));
return qnam;
}
@@ -298,6 +302,23 @@ void ShibbolethCredentials::invalidateAndFetch(Account* account)
job->start();
}
+void ShibbolethCredentials::slotHandleAuthentication(QNetworkReply *reply, QAuthenticator *authenticator)
+{
+ Q_UNUSED(reply)
+ QUrl url = reply->url();
+ // show only scheme, host and port
+ QUrl reducedUrl;
+ reducedUrl.setScheme(url.scheme());
+ reducedUrl.setHost(url.host());
+ reducedUrl.setPort(url.port());
+
+ AuthenticationDialog dialog(authenticator->realm(), reducedUrl.toString());
+ if (dialog.exec() == QDialog::Accepted) {
+ authenticator->setUser(dialog.user());
+ authenticator->setPassword(dialog.password());
+ }
+}
+
void ShibbolethCredentials::slotInvalidateAndFetchInvalidateDone(QKeychain::Job* job)
{
Account *account = qvariant_cast<Account*>(job->property("account"));
diff --git a/src/creds/shibbolethcredentials.h b/src/creds/shibbolethcredentials.h
index fe23ab2..85efe51 100644
--- a/src/creds/shibbolethcredentials.h
+++ b/src/creds/shibbolethcredentials.h
@@ -26,6 +26,8 @@ namespace QKeychain {
class Job;
}
+class QAuthenticator;
+
namespace Mirall
{
@@ -58,6 +60,7 @@ public:
public Q_SLOTS:
void invalidateAndFetch(Account *account);
+ void slotHandleAuthentication(QNetworkReply*,QAuthenticator*);
private Q_SLOTS:
void onShibbolethCookieReceived(const QNetworkCookie&, Account*);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list