Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should prompt the user to unlock the keychain when it is locked #92

Closed
rehaby opened this issue Feb 22, 2021 · 15 comments
Closed

Should prompt the user to unlock the keychain when it is locked #92

rehaby opened this issue Feb 22, 2021 · 15 comments
Labels
bug Something isn't working

Comments

@rehaby
Copy link

rehaby commented Feb 22, 2021

Describe the bug
When using a different password for gnome-keychain, than the login password. After logging in to spot, an error is shown saying failed to save password.

To Reproduce
Steps to reproduce the behavior:

  1. Open Spot
  2. Login Dialog shows
  3. Enter login details
  4. Dialog disappears
  5. Error dialog window displays saying "Failed to save password"

Expected behavior
When starting the app while the keychain is locked, a popup is displayed, asking you to unlock the keychain. For an example, Geary email app does this

Screenshots
None

General information:

  • Distribution: PostmarketOS
  • Installation method [e. g. built from source, installed from Flathub...]: Flathub
  • Version [e.g. 0.1.0]: 0.1.8
  • Device used [e. g. desktop, phone...]:Pinephone

Stack trace:
None

Additional context
None

@rehaby rehaby added the bug Something isn't working label Feb 22, 2021
@rehaby rehaby changed the title when gnome keychain is locked Fails to save password when gnome keychain is locked Feb 22, 2021
@xou816
Copy link
Owner

xou816 commented Feb 23, 2021

Hi! Thanks for your report :) I don't know how this dialog is triggered, I'll look into it sometime!

@xou816 xou816 changed the title Fails to save password when gnome keychain is locked Should prompt the user to unlock the keychain when it is locked Feb 24, 2021
@olof-nord
Copy link

This happens to me as well - the login is successful but a small message is shown "Failed to save password".
I do not find a way to save or add the password anywhere in the app though.

Package installed from AUR, steps to reproduce the same as in the description.

Using v0.1.8 with Arch Linux, 5.11.1-arch1-1, x86_64

@xou816
Copy link
Owner

xou816 commented Feb 24, 2021

You may unlock your keyring manually for this work, I should make the message more explicit. I'll look into implementing locking/unlocking over DBus but this will take some time!

@olof-nord
Copy link

Many thanks for the quick reply!

I had a look at the Arch Linux wiki, and found gnome-keyring-daemon -r -d.
It replaces any existing running daemon, and starts a new daemon.

https://wiki.archlinux.org/index.php/GNOME/Keyring#Tips_and_tricks

Having closed and re-opened my instance of Spot, I was not asked for my username/password again.

I do still get an email from Spotify each time I start spot though, but I suspect that is another issue.

@exciteabletom
Copy link

exciteabletom commented Mar 4, 2021

My underlying issue was that I didn't have a keychain setup. After following this guide to create one with seahorse, the problem is solved for me.

@xou816
Copy link
Owner

xou816 commented Mar 4, 2021

Good point, I should not expect people to have a keyring setup. Need to update some documentation!

xou816 added a commit that referenced this issue Mar 13, 2021
@SamMorrowDrums
Copy link

Eugh - I missed the set default keyring and wasted ages. Pinephone with KDE Plasma Manjaro. Until this is fixed, ensure that you have the keyring you create set to default in Seahorse otherwise it won't work.

@xou816
Copy link
Owner

xou816 commented Mar 18, 2021

Hi @SamMorrowDrums, sorry for your trouble! Would you mind sharing some details on how to setup this so that I can add more documentation or have better error messages?

@SamMorrowDrums
Copy link

SamMorrowDrums commented Mar 18, 2021

My Pinephone with KDE Plasma Manjaro setup went something like this:

sudo pacman -S  gnome-keyring libsecret libgnome-keyring

sudo nano /etc/pam.d/login

File should look like this when done:

auth       required     pam_securetty.so
auth       requisite    pam_nologin.so
auth       include      system-local-login
auth       optional     pam_gnome_keyring.so
account    include      system-local-login
session    include      system-local-login
session    optional     pam_gnome_keyring.so auto_start

If you use nano ctrl + x and then y to write and quit

then

sudo nano /etc/pam.d/sddm

# There are two lines already there starting with -
# - auth            optional        pam_gnome_keyring.so
# - session         optional        pam_gnome_keyring.so auto_start

# Remove those dashes  -  from the start of the lines, and save and exit again

Then install seahorse (which can be done in discover if you prefer, and in the gui - which is called Passwords & Keys - add a new password keychain (no password is easiest but make sure you understand that it is insecure). You might need to click the top left arrow as mine default opens to a GPG page, and you want the to be in the main overview.

Also worth noting: creating a new keychain was way easier with external monitor - the app is not mobile optimised at time of writing.

Then right click the password keychain and set as default

Now, restart phone, and it should all just work when you type password into Spot

If that fails, try opening seahorse, manually unlock keychain (also in right click menu on keychain) and then open spot again and type password and it should just work. At this point, at worst you have to unlock keychain before opening spot.

The info in the Arch wiki is correct, just as usual there are small details like set as default that are sometimes easy to miss, and make it still fail.

https://wiki.archlinux.org/index.php/GNOME/Keyring#Passwords_are_not_remembered

I also had to use an external keyboard (for me both to enter password in Bitwarden to get my spotify credentials, and to type them into spot).

Once that is done, the interface can be clicked around in spot without external keyboard for the most part at least, so it all works from there.

@SamMorrowDrums
Copy link

@xou816 done, I edited it like 8 times because there are various caveats - but hopefully this explains it well enough now.

@xou816
Copy link
Owner

xou816 commented Mar 18, 2021

Thank you so much, I did not expect such a detailed answer! I will add this to the README (unless you want to do it yourself of course).

@SamMorrowDrums
Copy link

SamMorrowDrums commented Mar 18, 2021 via email

@xou816
Copy link
Owner

xou816 commented Mar 18, 2021

Sure, I'll do it then, thanks! :) the Arch Wiki is such a valuable resource indeed!

@rstanuwijaya
Copy link

Hi, I'm encountering this problem when using steamdeck. I tried the mentioned solution, but the keyring doesnt unlock automatically because it seems like the user login process is not using sddm.

@xou816
Copy link
Owner

xou816 commented Feb 23, 2023

fixed recently i believe!

@xou816 xou816 closed this as completed Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants