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 15:27:08 +0800 Organization: Hong Kong University of Science and Technology Message-ID: <87bl6dllf7.fsf@ust.hk> References: <52589.36892.953561.24840@gargle.gargle.HOWL> <87r1fb7xbk.fsf@ust.hk> <871r7a2u9e.fsf@gnu.org> <87h7g6rps6.fsf@ust.hk> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35433"; 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:Qa6z/dwTdKlFR3al3VwQkKngU5U= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 04 09:28:05 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 1mBBJs-0008ze-PV for ged-emacs-devel@m.gmane-mx.org; Wed, 04 Aug 2021 09:28:04 +0200 Original-Received: from localhost ([::1]:39912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBBJr-0004k1-OA for ged-emacs-devel@m.gmane-mx.org; Wed, 04 Aug 2021 03:28:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBBJ9-0003xf-L9 for emacs-devel@gnu.org; Wed, 04 Aug 2021 03:27:19 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:37574) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBBJ8-0005Wu-BV for emacs-devel@gnu.org; Wed, 04 Aug 2021 03:27:19 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mBBJ6-00084Q-5l for emacs-devel@gnu.org; Wed, 04 Aug 2021 09:27:16 +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:272022 Archived-At: >>>>> "AC" == Andrew Cohen writes: >>>>> "RW" == Roland Winkler writes: RW> On Tue, Aug 03 2021, Andrew Cohen wrote: >>>>>>>> "RW" == Roland Winkler writes: [...] >>> 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. AC> No, this has nothing to do with oauth2---the automatic AC> refreshing works just fine. Its the auth-store that is asking AC> for a password to read the local plstore file (for some reason AC> it caches the password for some relatively short length of time, AC> but then decides it needs the password after a couple of hours). And finally taking the two minutes to read the documentation tells me that 'auth-source-cache-expiry is, by default, 2 hours:) Set this to nil and these annoying requests for my password go away. If anyone is interested, it seems that MS requires re-authentication of the client every 6 months (this has nothing to do with emacs). This hit me for the second time just after I sent my message yesterday that everything was working great. So now I know the exact date (one year ago) when I started using oauth2 with gnus :) -- Andrew Cohen