Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/creds
diff options
context:
space:
mode:
authorDaniel Molkentin <danimo@owncloud.com>2014-06-17 16:53:06 +0400
committerDaniel Molkentin <danimo@owncloud.com>2014-06-17 16:53:23 +0400
commitb91967f4d9720ec134e6cbb0341000a160157906 (patch)
tree939906b73c4c9a365fefc756d19f63c16357385b /src/creds
parent2d234cd96f92cd633d48ad5b73ba054b8d0879ee (diff)
Fix regression over 1.5: Fix non-fba auth for Shib IdPs
Diffstat (limited to 'src/creds')
-rw-r--r--src/creds/shibboleth/shibbolethwebview.cpp19
-rw-r--r--src/creds/shibboleth/shibbolethwebview.h1
-rw-r--r--src/creds/shibbolethcredentials.cpp21
-rw-r--r--src/creds/shibbolethcredentials.h3
4 files changed, 24 insertions, 20 deletions
diff --git a/src/creds/shibboleth/shibbolethwebview.cpp b/src/creds/shibboleth/shibbolethwebview.cpp
index c641d22c8..8a9f6d9db 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 1999dfde9..37b58c8cb 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 6c01efc53..d9e3217f2 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 fe23ab208..85efe51ad 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*);