[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to store SMTP credentials via Secret Service API?
From: |
Michael Albinus |
Subject: |
Re: How to store SMTP credentials via Secret Service API? |
Date: |
Thu, 13 Jun 2013 12:39:44 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
John Steele Scott <toojays@toojays.net> writes:
Hi John,
> If I eval something like:
>
> (secrets-create-item "Default" "toojays.net smtp" "my-secret-password"
> :host "my-mail-host"
> :port "587"
> :user "toojays@toojays.net")
>
> it errors like:
>
> Secret Service session: /org/freedesktop/secrets/session/s287
> byte-code: D-Bus error: "Method \"CreateItem\" with signature
> \"a{sv}(oayay)b\" on interface \"org.freedesktop.Secret.Collection\"
> doesn't exist
Yep, there was an extension to the Secret Service API, which was not
implemented yet in secrets.el. (For the curious ones: a "secret" struct
has now an additional content_type entry. The signature is "(oayays)" )
> Is there a workaround for this?
I've changed secrets.el in Emacs' trunk accordingly. If you don't run
Emacs dev version, you could download the file from
<http://git.savannah.gnu.org/cgit/emacs.git/plain/lisp/net/secrets.el?h=trunk>
> For instance, if I could create the key some other way (e.g. via
> seahorse), will Emacs be able to retrieve it?
Likely yes. You could call "M-x secrets-show-secrets" and navigate
through the items. If Emacs shows you your password which you have
created via seahorse, chances are good that it works.
> Have I even used the correct syntax to create the key?
Yes. I have used it during debugging (with the exception, that I have
used "session" insted of "Default", 'cause I didn't want to add the key
permanently).
OTOH, IIRC one could instruct auth-sources to create a password if it
doesn't exist yet. Then you don't need to fiddle with secrets.el directly.
> Thanks,
>
> John
Best regards, Michael.