Bug 165308

Summary: kopete does not save passwords correctly if it contains symbols
Product: [Applications] kopete Reporter: shishir verma <shiverma>
Component: libkopeteAssignee: Kopete Developers <kopete-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: alex.danila.web, dorin.scutarasu, kalpik, lamarque, uwolfer
Priority: NOR    
Version: 0.50.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Modify the Yahoo login URL to percent encode username and password

Description shishir verma 2008-06-29 13:28:17 UTC
Version:           0.12.7 (using 3.5.9 "release 49.1" , openSUSE 11.0)
Compiler:          Target: x86_64-suse-linux
OS:                Linux (x86_64) release 2.6.25.5-1.1-default

kopete remember password does not seem to work if the password contains any characters other than digits or alphabets. This is the case with atleast yahoo and gmail(jabber) accounts. I tested this by changing the passwords to be purely alphanumeric, in which case, the passwords were remembered. But the moment I restored the passwords that contained non alphanumeric characters, I ran into the problem of incorrect password.
Comment 1 Urs Wolfer 2008-06-29 17:02:38 UTC
Same here with Kopete from KDE 4.
Comment 2 Matt Rogers 2008-11-18 04:05:42 UTC
are you using kwallet or not?
Comment 3 shishir verma 2008-11-18 21:35:31 UTC
I am using kwallet now, but the save password feature might not necessarily need me to use kwallet. It works with kwallet, but I would like to believe that if kwallet is not desired, then the password should get saved properly. Or it should not be allowed to be saved if kwallet is not being used.
Comment 4 Malte S. Stretz 2010-07-15 11:14:32 UTC
*** Bug 224869 has been marked as a duplicate of this bug. ***
Comment 5 Malte S. Stretz 2010-07-15 11:15:00 UTC
*** Bug 233974 has been marked as a duplicate of this bug. ***
Comment 6 Alex Dănilă 2012-01-31 23:29:39 UTC
Hi,
the password and user name should be encoded before sending out. There's one function which needs to be modified like this:
void LoginTask::sendAuthSixteenStage1(const QString& sn, const QString& seed)
{
	const QString YahooTokenUrl = "https://login.yahoo.com/config/pwtoken_get?src=ymsgr&ts=&login=%1&passwd=%2&chal=%3";
	kDebug(YAHOO_RAW_DEBUG) << "seed:" << seed;
	m_stage1Data.clear();
	/* construct a URL from the seed and request tokens */
    QString encodedPassword(QUrl::toPercentEncoding(client()->password()));
    QString encodedUser(QUrl::toPercentEncoding(sn));
    QString fullUrl = YahooTokenUrl.arg(encodedUser, encodedPassword, seed);
	KUrl tokenUrl(fullUrl);
	KIO::Job* job = KIO::get(tokenUrl, KIO::Reload, KIO::HideProgressInfo);
	connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)),
	        this, SLOT(handleAuthSixteenStage1Data(KIO::Job*, const QByteArray&)));
	connect(job, SIGNAL(result(KJob*)),
	        this, SLOT(handleAuthSixteenStage1Result(KJob*)));
}

I'll to attach a patch file.
Alex
Comment 7 Alex Dănilă 2012-01-31 23:41:40 UTC
This works for Yahoo, other protocols might need to be for checked percent encoding too.
Comment 8 Alex Dănilă 2012-02-01 20:38:27 UTC
Created attachment 68412 [details]
Modify the Yahoo login URL to percent encode username and password
Comment 9 Lamarque V. Souza 2012-02-20 20:55:38 UTC
SVN commit 1281263 by lvsouza:

Modify the Yahoo login URL to percent encode username and password.
Fixes kopete does not save passwords correctly if it contains symbols
Thanks to Alex Dănilă for this patch.



 M  +3 -2      logintask.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1281263
Comment 10 Lamarque V. Souza 2012-02-20 21:02:42 UTC
SVN commit 1281264 by lvsouza:

Backport SVN commit 1281263 to the 4.8 branch:

Modify the Yahoo login URL to percent encode username and password.
Fixes kopete does not save passwords correctly if it contains symbols
Thanks to Alex Dănilă for this patch.



 M  +3 -2      logintask.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1281264
Comment 11 Urs Wolfer 2012-02-21 07:53:15 UTC
Is this fixed for all protocols? IIRC I have had this issue with MSN.
Comment 12 Lamarque V. Souza 2012-02-25 14:53:23 UTC
I use Kopete 4.8.0 with WLM protocol and password with non-alphanumeric characters. I can connect normally here. Actually, the only problem I had to connect in the past years was because of the server IP redirection Microsoft established in their servers some months ago.