Bug 102822 - import mozilla firefox passwords
Summary: import mozilla firefox passwords
Status: CONFIRMED
Alias: None
Product: kwalletmanager
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Mandrake RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Valentin Rusu
URL:
Keywords:
: 105796 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-30 09:19 UTC by Helge Hielscher
Modified: 2021-09-06 18:13 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Firefox Password Exporter XML to KWallet XML (1.92 KB, application/xml)
2010-11-06 17:08 UTC, Becheru Petru-Ioan
Details
XSL stylesheet to transform firefox password list to kde wallet password list (2.35 KB, application/xml)
2011-07-20 17:55 UTC, T Zumbrunn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Helge Hielscher 2005-03-30 09:19:29 UTC
Version:            (using KDE KDE 3.3.2)
Installed from:    Mandrake RPMs

It would save me quite some tome if I could import the data that is stored in the passwordmanager of mozilla suite and mozilla firefox.

( Note: Also there are bugs in the mozilla bugtracker about using kwalletmanager )
( https://bugzilla.mozilla.org/show_bug.cgi?id=278343 )
( https://bugzilla.mozilla.org/show_bug.cgi?id=278342 )
Comment 1 George Staikos 2005-09-11 15:58:20 UTC
*** Bug 105796 has been marked as a duplicate of this bug. ***
Comment 2 Tristan Miller 2008-08-20 20:51:58 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 Angel Blue01 2009-03-04 03:46:43 UTC
If Konqueror ever hopes to replace Firefox as the browser of choice in KDE it needs to make it simple to import Firefox settings. Passwords are a start.
Comment 4 m.wege 2009-04-06 22:55:32 UTC
I believe this should work the other way around. Firefox should use Kwallet as a password manager. This would be actually a wish for Firefox then, but I think that it is good having it here too. Because the it wont happen from the Firefox-side. They don't care much about Linux and KDE. So it would be good if KDE, if one of the distros stepped in to provide a plugin which takes over the password-management.
Comment 5 Becheru Petru-Ioan 2010-11-06 17:08:48 UTC
Created attachment 53201 [details]
Firefox Password Exporter XML to KWallet XML

Firefox password are kept in a file called 'signons.sqlite'. This is a sqlite database file that contains two tables: moz_logins and moz_disabledHosts. It can be opened for analisis with a program named SQLite Database Browser (sqlitebrowser) .

The moz_logins table constains the following fields: id(integer),hostname(text), httpRealm(text), formSubmitURL(text), usernameField(text), passwordField(text), encryptedUsername(text), encryptedPassword(text), guid(text)  and encType(integer). The important fields for us are hostname, usernameField, passwordField, encryptedUsername and encryptedPassword.

The file can be exported to a XML using the Password Exported addon for Firefox ( https://addons.mozilla.org/en-US/firefox/addon/2848/ ). The format of the exported XML is:
<xml>
<entries>
...
<entry host="http://www.example.com" user="myUser@gmail.com" password="12345" formSubmitURL="http://www.example.com" httpRealm="" userFieldName="userinput" passFieldName="passwordinput"/>
....
</entries>
</xml>

This XML can be transformed to a XML file that can be imported into KWallet using the XSLT file attached. Here are the steps:
1. Using Firefox Password Exporter export the passwords to a XML file.
2. Apply the attached xslt to the XML file
3. The resulted XML should be merged into KWallet:
  3.1 Open KWallet Manager
  3.2 Open the wallet where you want the passwords to be saved(eg click on its icon)
  3.3 Use menu File->Merge to select the XML.

But their are some nasty things :

1. Firefox does not save the webpage where the form is, it saves just the base URL

lets say that the login form is found at http://www.example.com/index.php?section=login . The form is:

<form method="post" action="index.php">
	<input type="hidden" value="login" name="section"/>
	<fieldset>
		<legend>Identificare</legend>
		<input type="text" name="username"/> UserName [use '-@._a-z0-9' ; 64 chars max]<br/>
		<input type="password" name="password"/> Password [use 'a-z0-9' ; 64 chars max]<br/>
		<input type="submit" value="Login"/>
	</fieldset>
</form>

the entry in Firefox will be:

<entry host="http://www.example.com" user="myUser@gmail.com" password="12345" formSubmitURL="http://www.example.com" httpRealm="" userFieldName="username" passFieldName="password"/>

but in KWallet XML it should be:

<map name="http://www.example.com/index.php#">
	<mapentry name="password">12345</mapentry>
	<mapentry name="username">myUser@gmail.com</mapentry>
</map>

We can not guest the the Firefox entry that we should add to the host attribute the string "index.php#". Without it the KWallet will not be triggered to complete the user and password.

2. Firefox can save more than one entry for a website. KWallet seems it doed not accept this. You will be asked at import so skip entries that refer to the same URL.

PS I hope that the XML that I wrote in this comment will show up. Else I will make another attachment with this comment. Probably it will be attachment #2 [details] .
Comment 6 Becheru Petru-Ioan 2010-11-06 17:18:11 UTC
Notes on previous comment #5 :

1. You must get source of attachment #53201 [details] (the XSLT file). To get it right-click->Save link as or click and then View Source.
2. The is an Automatic As You Type Online XSLT Processor where you can test the XSLT : http://online-xslt-processor.tk/
Comment 7 T Zumbrunn 2011-07-20 17:55:40 UTC
Created attachment 62032 [details]
XSL stylesheet to transform firefox password list to kde wallet password list
Comment 8 T Zumbrunn 2011-07-20 18:01:03 UTC
Comment on attachment 62032 [details]
XSL stylesheet to transform firefox password list to kde wallet password list

I cannot reproduce the problems outlined in by Becheru Petru-Ioan in comment #5, probably due to newer versions of Firefox and/or KDE wallet. The attached XSL stylesheet worked well for me to with Firefox 5.0, the extension Password Exporter 1.2.1 and KDE wallet 1.7. In contrast to the instructions in comment #5, I used "File > Import XML..." in KDE wallet to import the resulting XML file into an existing KDE wallet.
Comment 9 T Zumbrunn 2011-07-20 18:07:40 UTC
I forgot the version number for the KDE wallet password integration extension for Firefox: 0.9.
Comment 10 Borden 2016-04-20 16:20:49 UTC
I got http://www.guillermomolina.com.ar/en/projects/63-firefox-kwallet5 working for me on Debian. Can this be considered a 'fix' to the problem?
Comment 11 Jack 2021-09-03 00:38:37 UTC
The link in Comment 10 goes to the author's home page, and although I can find the project page, the link for the actual plugin gives a 404.  Has this moved?  Is there any hope here?
Comment 12 Becheru Petru-Ioan 2021-09-03 11:37:31 UTC
(In reply to Jack from comment #11)
> The link in Comment 10 goes to the author's home page, and although I can
> find the project page, the link for the actual plugin gives a 404.  Has this
> moved?  Is there any hope here?

https://web.archive.org/web/20151128081105/http://www.guillermomolina.com.ar/en/projects/63-firefox-kwallet5

with link here

https://store.kde.org/p/1080814/
Comment 13 Jack 2021-09-03 14:51:09 UTC
Thanks, but I get "This add-on could not be installed because it appears to be corrupt."  I can unzip without problem, and the file layout within looks right, so it's not simple file corruption.  One question I have it that within install.rdf it lists a maximum version of firefox as 47.0 - could that be it?  I wonder if it is actually reasonable to expect it to still work with no updates in five years, given the changes to both Firefox and KDE?
Comment 14 Jack 2021-09-03 15:06:16 UTC
OK - I think it is just that the name/format of some of the files (manifest and install.rdf) has changed in the last five years.  I'm trying to find what they need to look like now, and just hope that the rest of the files are still good enough for the new firefox.
Comment 15 Jack 2021-09-06 18:13:04 UTC
I've played with it a bit more, and I believe the problem is actually that the whole layout and format of the files that make up a plug-in have changed, not just one or two files.  I'll keep trying to rework this in my free time, but that also assumes that the core library (.so) files will still work with the current version of kwallet.