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: Mon, 09 Aug 2021 08:01:30 +0800 Organization: Hong Kong University of Science and Technology Message-ID: <87fsvj32qt.fsf@ust.hk> References: <52589.36892.953561.24840@gargle.gargle.HOWL> <87pmuofpai.fsf@gnu.org> <87bl68la88.fsf@linux-m68k.org> <87eeb3fqfx.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="35606"; 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:2dKv0XTnA59TqEUwi1vkWqlEvjc= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 09 02:02:43 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 1mCskc-00095B-VS for ged-emacs-devel@m.gmane-mx.org; Mon, 09 Aug 2021 02:02:42 +0200 Original-Received: from localhost ([::1]:51550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCskb-0007uI-Rc for ged-emacs-devel@m.gmane-mx.org; Sun, 08 Aug 2021 20:02:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCsjl-00075k-G2 for emacs-devel@gnu.org; Sun, 08 Aug 2021 20:01:49 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:40688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCsjj-0007TF-5e for emacs-devel@gnu.org; Sun, 08 Aug 2021 20:01:49 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mCsje-0007yV-7N for emacs-devel@gnu.org; Mon, 09 Aug 2021 02:01:42 +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: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.248, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:272218 Archived-At: >>>>> "RW" == Roland Winkler writes: [...] RW> Thanks. My reading of the code of oauth2.el is that RW> oauth2-compute-id derives the id for plstore from auth-url, RW> token-url, and scope. It seems to me that this will get RW> confused with, say, two different Office365 accounts that have RW> the same auth-url, token-url, and scope. Should the code use RW> also additional information such as the user name? (I do not RW> know much about plstore.el used by oauth2.el.) oauth2 is primarily focused on accessing web-based resources, not service based ones such as imap or smtp. For imap the most common way to control authentication is through auth-source which does indeed use the user name (and host name and port) to distinguish entries. As I described in an earlier email this all works quite well (for me) although the plstore is handled separately from oauth2. And this method isn't tied to plstore, but works fine with the other auth-source backends (like an .authinfo file). Having said that, it may not hurt to extend/modify oauth2 to interact better with auth-store. My preference would be to focus ouath2 on the token management and leave the actual resource interaction (including storing tokens) to the tools that are already doing that. Best, Andy --