Closed bairog closed 2 months ago
Sample code works only if I don't enter a passphrase to protect my gpg key (that I generate with gpg --gen-key
). But if I enter any passphrase - described exception is thrown. Looks like OS waits for a passphrase to be entered. Is there any workaround?
Ok, looks like WSL2 terminal window is treated as Headless/TTY-only session
and therefore according to GCM docs I need to add export GPG_TTY=$(tty)
to ~/.bashrc or ~/.profile file. After that a prompt started to open WSL2 terminal window (or in a GUI window if Seahorse is installed):
If GPG key passphrase is not empty GPG/pass compatible files credential store also requires user interaction (via GUI or terminal prompt)? Is there any workaround to enter a passphrase via API?
I'm pretty sure that's by design of the underlying API from GCM. This API is tested to work with all providers that don't require a passkey across all supported OSes on CI on every commit.
Buy that's the core scenario: to work on non-interactive usage, not to try to automate UI that's driven by the OS.
@kzu "to work on non-interactive usage" - do you mean gpg key without any passphrase is the only option? Secret Service API definitelly require GUI, Git credential cache is not persistent, Plaintext files are not secure at all. So GPG/pass compatible files is the only non-interactive store available on Linux, right?
I guess. But as I said, that's all external to this library.
Describe the Bug
I've installed WSL2 (Ubuntu 22.04.4 LTS distro) on my Windows 11 23H2 x64 Pro. I've configured GPG/pass compatible files credential store for gpg-id
admin <admin@admin.com>
. I've created .NET 6.0 console application (Visual Studio 2022) with sample code from this repository and started debugging on WSL2. I've got an exception on credential retrieve withCredential cred = store.Get("https://foo.com", "myusr");
:Is it a bug or how to fix that? Thank you.
Steps to Reproduce
Expected Behavior
Credential is retreived with no problem.
Exception with Stack Trace
Version Info
Devlooped.CredentialManager Version="2.5.0.1"