From 065690c2cead75efa142cb54a7d8682cd7bfde7b Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 25 Feb 2014 09:32:31 +0100 Subject: [PATCH] Shibboleth: Have proper invalidation if timeout during sync --- src/creds/shibbolethcredentials.cpp | 14 ++++++++++++++ src/creds/shibbolethcredentials.h | 1 + 2 files changed, 15 insertions(+) diff --git a/src/creds/shibbolethcredentials.cpp b/src/creds/shibbolethcredentials.cpp index 9e5e847c87..7b7019ac43 100644 --- a/src/creds/shibbolethcredentials.cpp +++ b/src/creds/shibbolethcredentials.cpp @@ -254,6 +254,20 @@ void ShibbolethCredentials::slotBrowserHidden() void ShibbolethCredentials::invalidateAndFetch(Account* account) { _ready = false; + + // delete the credentials, then in the slot fetch them again (which will trigger browser) + DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName()); + job->setProperty("account", QVariant::fromValue(account)); + job->setSettings(account->settingsWithGroup(Theme::instance()->appName())); + connect(job, SIGNAL(finished(QKeychain::Job*)), SLOT(slotInvalidateAndFetchInvalidateDone(QKeychain::Job*))); + job->setKey(keychainKey(account->url().toString(), "shibAssertion")); + job->start(); +} + +void ShibbolethCredentials::slotInvalidateAndFetchInvalidateDone(QKeychain::Job* job) +{ + Account *account = qvariant_cast(job->property("account")); + connect (this, SIGNAL(fetched()), this, SLOT(onFetched())); // small hack to support the ShibbolethRefresher hack diff --git a/src/creds/shibbolethcredentials.h b/src/creds/shibbolethcredentials.h index 1a59547fec..b3f922f030 100644 --- a/src/creds/shibbolethcredentials.h +++ b/src/creds/shibbolethcredentials.h @@ -60,6 +60,7 @@ private Q_SLOTS: void slotBrowserHidden(); void onFetched(); void slotReadJobDone(QKeychain::Job*); + void slotInvalidateAndFetchInvalidateDone(QKeychain::Job*); Q_SIGNALS: void newCookie(const QNetworkCookie& cookie);