From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Steele Scott Newsgroups: gmane.emacs.help Subject: Re: How to store SMTP credentials via Secret Service API? Date: Mon, 17 Jun 2013 13:23:23 +0930 Message-ID: <51BE8833.9040409@toojays.net> References: <87vc5i47m7.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1371441254 20025 80.91.229.3 (17 Jun 2013 03:54:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Jun 2013 03:54:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 17 05:54:16 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UoQWG-0002Rs-2z for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Jun 2013 05:54:16 +0200 Original-Received: from localhost ([::1]:45638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoQWF-0005Ap-Pb for geh-help-gnu-emacs@m.gmane.org; Sun, 16 Jun 2013 23:54:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoQW3-0005Ag-Iv for help-gnu-emacs@gnu.org; Sun, 16 Jun 2013 23:54:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UoQW2-0000Q2-4t for help-gnu-emacs@gnu.org; Sun, 16 Jun 2013 23:54:03 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:46886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoQW1-0000Pp-Vb for help-gnu-emacs@gnu.org; Sun, 16 Jun 2013 23:54:02 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UoQVt-0001kt-KF for help-gnu-emacs@gnu.org; Mon, 17 Jun 2013 05:53:58 +0200 Original-Received: from 146.174.200.100 ([146.174.200.100]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Jun 2013 05:53:53 +0200 Original-Received: from toojays by 146.174.200.100 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Jun 2013 05:53:53 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 64 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 146.174.200.100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 In-Reply-To: <87vc5i47m7.fsf@gmx.de> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91575 Archived-At: Thanks Michael for your reply. On 13/06/13 20:09, Michael Albinus wrote: > John Steele Scott 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 > I downloaded the new version, and used "load-file" to get it into my Emacs 24.3. I still had no success when trying to set the secret with secrets-create-item though. >> 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. Okay, seahorse was no good, because at least with the version I had (3.2.2), I couldn't see a way to set any properties such as host/port/username with the secret. However, I found some python attached to this article which shows how to interface with gnome-keyring to set keys. I set the key that way, which seems to work fine. >> 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. I did start there, but auth-sources complains that "The Secrets API auth-source backend doesn't support creation yet" Thanks again, John