Logging in to LinkedIn account is impossible with Qt WebKit. The problem appears with the normal web site login page as well as the LinkedIn XML API OAuth authentication page. The problem is easy to reproduce with Qt WebKit fancybrowser example by entering LinkedIn website and trying to log in to the site. OAuth authentication page gives the following error message after entering username and password: "Request Error We're sorry, there was a problem with your request. Please make sure you have cookies enabled and try again." Disabling Javascript has no effect. Based on this thread http://developer.linkedin.com/thread/1488?start=0&tstart=0, it can have something todo with the CSRF security cookies.
Indeed, I cannot log in. Please follow this to report bugs on QtWebKit: http://trac.webkit.org/wiki/QtWebKitBugs Otherwise the bug do not get triaged directly.
For what it's worth, I came across this in another context and at least in that case, the source of the problem was whether cookies were quoted or not. They put some extraneous quotes around some cookie values and if they don't get them back with those quotes, they won't validate the request.
Yes I can confirm that the issue is in quoted cookies. After overriding the cookie handling and qouting the neccesary cookies I am able to login and use Linkedin normaly. Here is the code I use inside QNetworkReply * createRequest overidded method: QList<QNetworkCookie> cookies = cookieJar()->cookiesForUrl(temp.url()); QByteArray arrCookies; if (!cookies.isEmpty()) { foreach(QNetworkCookie cookie, cookies) { QByteArray name = cookie.name(); QByteArray value = cookie.value(); if(name == "JSESSIONID" || name == "leo_auth_token" || name == "bcookie" || name == "lang") { QString val = QString("%1=\"%2\"; ").arg(QString(name)).arg(QString(value)); arrCookies.append(val); } else { QString val = QString("%1=%2; ").arg(QString(name)).arg(QString(value)); arrCookies.append(val); } } arrCookies = arrCookies.left(arrCookies.lastIndexOf(";")).trimmed(); temp.setRawHeader("Cookie",arrCookies); _linkedIn->setRawHeader(arrCookies); QNetworkCookieJar* jar = new QNetworkCookieJar(this); this->cookieJar()->deleteLater(); this->setCookieJar(jar);
I just created a bug report in the Qt bug tracker: http://bugreports.qt.nokia.com/browse/QTBUG-17746
(In reply to comment #4) > I just created a bug report in the Qt bug tracker: http://bugreports.qt.nokia.com/browse/QTBUG-17746 It's a P1 at least. Linkedin is a very popular website so it needs to be solved when we're gonna release QtWebKit 2.2.
> It's a P1 at least. Linkedin is a very popular website so it needs to be solved when we're gonna release QtWebKit 2.2. Why would it be a P1? AFAIK it has never worked, so it is not a regression, and neither is it a crash, so it is P2. But anyway, the fix version of the bug is set to 4.7.3 (it is too late for 4.7.2), so where is the problem?
It'(In reply to comment #6) > > It's a P1 at least. Linkedin is a very popular website so it needs to be solved when we're gonna release QtWebKit 2.2. > > Why would it be a P1? AFAIK it has never worked, so it is not a regression, and neither is it a crash, so it is P2. But anyway, the fix version of the bug is set to 4.7.3 (it is too late for 4.7.2), so where is the problem? Then I'm fine if it goes for 4.7.3 or 4.8.0 no matter what is the priority. Thanks for the work. On side note : to me it sounds a P1 even though it's not a regression or crash. It's a major functional issue. It's basically like saying class QFoo can not be constructed. It not a regression (it's a new class) neither a crash but you can't construct it/use it. It's the same here. I'm nitpicking Peter :).
The problem is in QNetworkCookie class that QtWebKit uses. Created a merge request http://qt.gitorious.org/qt/qt/merge_requests/1118
http://bugreports.qt.nokia.com/browse/QTBUG-17746 has been fixed in 4.7 branch, logging in to linkedin.com works, verified with the Qt demo browser.
(In reply to comment #9) > http://bugreports.qt.nokia.com/browse/QTBUG-17746 has been fixed in 4.7 branch, logging in to linkedin.com works, verified with the Qt demo browser. Thanks Peter for fixing the bug (and for reporting the result here). I close this bug since this is now fixed.