From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrew Cohen Newsgroups: gmane.emacs.devel Subject: Re: oauth2 support for Emacs email clients Date: Wed, 04 Aug 2021 08:56:25 +0800 Organization: Hong Kong University of Science and Technology Message-ID: <87h7g6rps6.fsf@ust.hk> References: <52589.36892.953561.24840@gargle.gargle.HOWL> <87r1fb7xbk.fsf@ust.hk> <871r7a2u9e.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35340"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:c2oMu1RfTWV57BKbZMKXb+GczVI= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 04 02:59:50 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mB5GA-0008yn-Ec for ged-emacs-devel@m.gmane-mx.org; Wed, 04 Aug 2021 02:59:50 +0200 Original-Received: from localhost ([::1]:54638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mB5G9-0000XV-Ek for ged-emacs-devel@m.gmane-mx.org; Tue, 03 Aug 2021 20:59:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mB5D4-0000nN-Qg for emacs-devel@gnu.org; Tue, 03 Aug 2021 20:56:38 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:39080) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mB5D2-0006oq-OM for emacs-devel@gnu.org; Tue, 03 Aug 2021 20:56:38 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mB5D0-0004Sy-8K for emacs-devel@gnu.org; Wed, 04 Aug 2021 02:56:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.248, NICE_REPLY_C=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272013 Archived-At: >>>>> "RW" == Roland Winkler writes: RW> On Tue, Aug 03 2021, Andrew Cohen wrote: >>>>>>> "RW" == Roland Winkler writes: >> But the truly hacky part---the information for refreshing the >> token is stored in an auth-source file, where the "secret" is a >> function that refreshes the token and returns the new credential. >> >> Once set up it works pretty well (although it asks for the >> password for the auth-source file frequently---I haven't had time >> to learn how auth-source decides when a password is required so >> this should be easily fixable---its not frequent enough to really >> bother me and my emacs time is very limited these days). RW> As I said in another reply to this thread, I believe that the RW> problem with frequent password requests is due to the fact that RW> oauth2.el does not support `access_type=offline' upon RW> authentication. No, this has nothing to do with oauth2---the automatic refreshing works just fine. Its the auth-store that is asking for a password to read the local plstore file (for some reason it caches the password for some relatively short length of time, but then decides it needs the password after a couple of hours). Just to be really clear, all of the oauth2 stuff works automatically and just fine (including for smtp for sending email). >> If you want to try it let me know and I'll try to walk you >> through the setup. RW> Thanks, I got this part working. But I realized that davmail RW> mentioned elsewhere in this thread gives me, all in all, a RW> smoother work flow. >> diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el >> >> diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el RW> I suggest to apply these steps to the emacs trunk, as one step RW> towards better oauth2 support. Yes, I have been waiting for a good time to update my local emacs repository so I can do a clean push. Not much time for emacs these days. --