go-keyring icon indicating copy to clipboard operation
go-keyring copied to clipboard

[Linux] failed to unlock correct collection '/org/freedesktop/secrets/aliases/default'

Open songant opened this issue 1 year ago • 2 comments

Using go-keyring to save passwords locally works fine on Mac and Windows, but reports an error on Linux: failed to unlock correct collection '/org/freedesktop/secrets/aliases/default'. gnome-keyring and dbus-x11 has been installed on the virtual machine. This is a desktop-free environment

songant avatar Oct 28 '24 09:10 songant

Shouldn't this limitation be documented in the README? The current situation significantly limits the usability of the library to only two operating systems, and the README still claims that it works on Linux. Without a functional workaround, users are forced to resort to unsafe practices such as leaking their tokens through shell history or hardcoding them into configuration files.

timwehrle avatar Dec 05 '24 13:12 timwehrle

You can see how we test the library on a headless Linux environment here: https://github.com/zalando/go-keyring/blob/b38ab4b7224a1f2d243fc35cd3a646ad1cdcdf40/.github/workflows/go.yml#L45-L49

It works on Linux, but there are prerequisites like a working keyring. The tool is intended for human users to store credentials which normally assumes a desktop environment. Contributions are welcome on how to make it work or document limitations for other environments.

mikkeloscar avatar Dec 05 '24 13:12 mikkeloscar