Bug 349003 - Transition pam-kwallet to kwallet5 -- allowing single-sign-on
Summary: Transition pam-kwallet to kwallet5 -- allowing single-sign-on
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kwallet
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Alex Fiestas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-10 21:13 UTC by Leon Maurer
Modified: 2016-10-01 01:16 UTC (History)
43 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch to kf5 kwallet (4.22 KB, patch)
2015-07-16 09:55 UTC, Cjacker
Details
patch to pam-kwallet git codes. (1.61 KB, patch)
2015-07-16 09:58 UTC, Cjacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leon Maurer 2015-06-10 21:13:20 UTC
In many ways, this is a continuation of bug 92845. Details are available there.

A long-standing feature request was for single-sign-on -- where logging in would automatically unlock kwallet. (A very useful feature.) The issue was raised in 2004 with bug 92845 and was finally addressed in 2014. However, about a year later, this feature was removed with the transition to KDE 5.

Please bring this feature back! (We already waited a decade!)

Reproducible: Always
Comment 1 Arne Brix 2015-06-11 04:05:24 UTC
oh yes please.
Comment 2 Till Schäfer 2015-06-11 11:31:10 UTC
With the gnupg backend this may shift towards a pam module to unlock the gpg key similar to  pam_ssh [1].

[1] http://www.unix.com/man-page/debian/8/pam_ssh/
Comment 3 Murz 2015-06-11 17:15:59 UTC
Seems that in Kubuntu 15.04 there are some improvements on this feature: I see signon-kwallet-extension and pam-kwallet packages. Is this packages from KDE or Ubuntu developers?
Comment 4 Leon Maurer 2015-06-11 17:33:47 UTC
@Murz,

I contact the Kubuntu folks first and they said that there wasn't anything they could do: https://bugs.launchpad.net/ubuntu/+source/kubuntu-meta/+bug/1451865

Still, I'd be curious to know about those packages.
Comment 5 Valentin Rusu 2015-06-14 07:35:58 UTC
Hello Alex, pam-kwallet is still in your scratch repositories. I think pam-kwallet should end in KF5::Wallet framework, into the runtime directory.

Do you plan to port it to KF5? Do you need help with that?
Comment 6 Alex Fiestas 2015-06-14 22:30:59 UTC
I don't have plans (or time) at this very moment, so please feel free to take over.
Comment 7 Cjacker 2015-07-16 09:55:01 UTC
Created attachment 93611 [details]
patch to kf5 kwallet

patch to kf5 kwallet, enable pam_kwallet support. codes directly token from kde4.
Comment 8 Cjacker 2015-07-16 09:58:04 UTC
Created attachment 93612 [details]
patch to pam-kwallet git codes.

git clone git://anongit.kde.org/scratch/afiestas/pam-kwallet.git
And apply this patch.

changes:
1, kdehome not needed anymore, since kwalletd store files in ~/.local/share/kwalletd/
2, Change path of kdewallet.salt accordingly.
Comment 9 Cjacker 2015-07-16 10:10:45 UTC
pam_kwallet still had some limitions:

1, it only handle wallet named 'kdewallet'.

2, If you had 'kdewallet' created already, need to set the wallet password as same as account password.

3, it did not implement 'pam_sm_chauthtok' currently, that's to say, use 'passwd' utility  to change account password,  will NOT change 'wallet' password, kwallet still use the old password, you need to change it manually.

I checked kwalletd/kwallet codes and found it is REALLY difficult to change runtime kwallet password via pam_sm_chauthtok.  kwallet load everything to memory, if password changed via kwalletmanager5, it will sync back via kwallet backend.  change 'salt' from outside can not change the password of wallet.
Comment 10 kolAflash 2015-07-20 13:04:55 UTC
@Cjacker
Please keep in mind: Those limitations might be ugly. But the core functionality of pam_kwallet (logging in without typing the password twice) is what people really need! So that should have priority.
Comment 11 Leon Maurer 2015-07-22 01:54:47 UTC
@Cjacker I'm not in a position to test your patch, but I may owe you a beer. Thanks for helping out!
Comment 12 Valentin Rusu 2015-08-04 17:07:31 UTC
(In reply to Cjacker from comment #9)
> pam_kwallet still had some limitions:
> 
> 1, it only handle wallet named 'kdewallet'.
> 
> 2, If you had 'kdewallet' created already, need to set the wallet password
> as same as account password.
> 
> 3, it did not implement 'pam_sm_chauthtok' currently, that's to say, use
> 'passwd' utility  to change account password,  will NOT change 'wallet'
> password, kwallet still use the old password, you need to change it manually.
> 
> I checked kwalletd/kwallet codes and found it is REALLY difficult to change
> runtime kwallet password via pam_sm_chauthtok.  kwallet load everything to
> memory, if password changed via kwalletmanager5, it will sync back via
> kwallet backend.  change 'salt' from outside can not change the password of
> wallet.

This one is true. But good news - the replacement KSecrets Service will handle that for you automagically.
Comment 13 Valentin Rusu 2015-08-04 17:12:37 UTC
See https://git.reviewboard.kde.org/r/124413/
Comment 14 Manuel Bärenz 2015-09-26 10:39:18 UTC
What is the correct configuration in the PAM files to get this working? At least under Gentoo, this doesn't work: https://bugs.gentoo.org/show_bug.cgi?id=561470
Comment 15 Valentin Rusu 2015-11-15 20:54:47 UTC
(In reply to Manuel Bärenz from comment #14)
> What is the correct configuration in the PAM files to get this working? At
> least under Gentoo, this doesn't work:
> https://bugs.gentoo.org/show_bug.cgi?id=561470

Google:
https://www.dennogumi.org/2014/04/unlocking-kwallet-with-pam/
Comment 16 Manuel Bärenz 2015-11-16 09:16:03 UTC
(In reply to Valentin Rusu from comment #15)
> (In reply to Manuel Bärenz from comment #14)
> > What is the correct configuration in the PAM files to get this working? At
> > least under Gentoo, this doesn't work:
> > https://bugs.gentoo.org/show_bug.cgi?id=561470
> 
> Google:
> https://www.dennogumi.org/2014/04/unlocking-kwallet-with-pam/

This is for KDE4, and it doesn't work for kwallet5.