void ShibbolethWebView::onNewCookiesForUrl (const QList<QNetworkCookie>& cookieList, const QUrl& url) { if (url.host() == _account->url().host()) { QNetworkCookie shibCookie = ShibbolethCredentials::findShibCookie(_account.data(), cookieList); if (shibCookie != QNetworkCookie()) { Q_EMIT shibbolethCookieReceived(shibCookie); accept(); close(); } } }
void OwncloudShibbolethCredsPage::disposeBrowser() { if (_browser) { disconnect(_browser, SIGNAL(otherCookiesReceived(QList<QNetworkCookie>, QUrl)), this, SLOT(slotOtherCookiesReceived(QList<QNetworkCookie>, QUrl))); disconnect(_browser, SIGNAL(viewHidden()), this, SLOT(slotViewHidden())); disconnect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie)), this, SLOT(slotShibbolethCookieReceived(QNetworkCookie))); _browser->hide(); _browser->deleteLater(); _browser = 0; } }
void OwncloudShibbolethCredsPage::setupBrowser() { if (_browser) { return; } OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard*>(wizard()); _browser = new ShibbolethWebView(ocWizard->account()); connect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie)), this, SLOT(slotShibbolethCookieReceived(QNetworkCookie))); connect(_browser, SIGNAL(viewHidden()), this, SLOT(slotViewHidden())); connect(_browser, SIGNAL(otherCookiesReceived(QList<QNetworkCookie>, QUrl)), this, SLOT(slotOtherCookiesReceived(QList<QNetworkCookie>, QUrl))); _browser->show(); _browser->setFocus(); }
void ShibbolethCredentials::fetch(Account *account) { if (_ready) { Q_EMIT fetched(); } else { ShibbolethConfigFile cfg; if (account) { _url = account->url(); } _browser = new ShibbolethWebView(account, cfg.createCookieJar()); connect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie)), this, SLOT(onShibbolethCookieReceived(QNetworkCookie))); connect(_browser, SIGNAL(viewHidden()), this, SLOT(slotBrowserHidden())); _browser->show (); } }
void ShibbolethWebView::onNewCookiesForUrl (const QList<QNetworkCookie>& cookieList, const QUrl& url) { QList<QNetworkCookie> otherCookies; QNetworkCookie shibCookie; Q_FOREACH (const QNetworkCookie& cookie, cookieList) { if (cookie.name().startsWith ("_shibsession_")) { if (shibCookie.name().isEmpty()) { shibCookie = cookie; } else { qWarning() << "Too many Shibboleth session cookies at once!"; } } else { otherCookies << cookie; } } if (!otherCookies.isEmpty()) { Q_EMIT otherCookiesReceived(otherCookies, url); } if (!shibCookie.name().isEmpty()) { Q_EMIT shibbolethCookieReceived(shibCookie, _account); } }