From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thomas Fitzsimmons Newsgroups: gmane.emacs.devel Subject: Re: Extending auth-source and plstore for more XOAUTH2 scenarios Date: Thu, 11 May 2023 17:04:20 -0400 Message-ID: References: <53d1fe04-9c66-fd9c-a9a4-3f7a05792b36@vodafonemail.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31510"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Farblos Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 11 23:05:04 2023 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 1pxDTD-0007zU-2x for ged-emacs-devel@m.gmane-mx.org; Thu, 11 May 2023 23:05:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pxDSe-0007WS-HJ; Thu, 11 May 2023 17:04:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pxDSc-0007WD-2r for emacs-devel@gnu.org; Thu, 11 May 2023 17:04:26 -0400 Original-Received: from mail.fitzsim.org ([69.165.165.189]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pxDSZ-0006CH-Gt for emacs-devel@gnu.org; Thu, 11 May 2023 17:04:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fitzsim.org ; s=20220430; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=iREcuhWmG3obzoawSaptrj8xV1KRzOljJpiigBLZWf0=; b=atYxd660X0/Nug4vm6PTd9gAKT imCyvgrfy5vCOZemUui+rHBLLgAKqSgRO+vvuDnkJo3Zq612Dy/4jYEhS7agt5R11WRsJ9ORhCEcd MU1oDLQkVo3A64roBKz7SkP1Ok6VYejTdWfGQbX/eqtO8ci6IsrzAf4m+9qJf/a6Bz1Fg115VA1uF abxT2MlI9narfwMGtz9y0SAZu7ljOmsiEdW3XDSVgu6FKpqVbHj5c8ADdGTUrGQxzCbZrlnElZNHe bPyKPoZ0pILJk5tWuVaJOUfZ/YnE753ES3X7jKWTGowPux7XDaZtNKTg0/LoeIvtddlTWgPpCBS0c d0O4cbRA==; Original-Received: from [192.168.1.1] (helo=localhost.localdomain) by mail.fitzsim.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pxDSW-000ACP-OE; Thu, 11 May 2023 17:04:20 -0400 In-Reply-To: <53d1fe04-9c66-fd9c-a9a4-3f7a05792b36@vodafonemail.de> (Farblos's message of "Thu, 11 May 2023 22:22:11 +0200") Received-SPF: pass client-ip=69.165.165.189; envelope-from=fitzsim@fitzsim.org; helo=mail.fitzsim.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306067 Archived-At: Hi Farblos, Farblos writes: > I've made some extensions to package auth-source and plstore to cover > more XOAUTH2 scenarios. My employer uses MS Office 365 with a device > grant for the MUTT/Gnus/whatever outcasts, where you need additional > URL parameters to refresh an access token. Plus I store the access > token *and* its expiry date in a plstore to avoid token refresh cycles > as much as possible. [...] > So much for the bigger picture. What do you think? It would indeed be nice to have in GNU ELPA a package that has configuration logic for IMAP/SMTP/POP3 OAuth 2.0. I currently use the https://github.com/harishkrupo/oauth2ms Python script for IMAP and SMTP XOAUTH2. Have you seen it? It's got excellent documentation and the script has been solid. However, I would prefer to eliminate the external Python script and have a pure Elisp solution. It sounds like that's what you'd like to contribute, in which case, great! Also have a look at url-http-oauth, which I just released to GNU ELPA this week. It provides OAuth 2.0 support for HTTP services, and uses the auth-source netrc backend. See if you may be able to make use of parts of it. I started with netrc support because that's what I use, and because authinfo.gpg can be GPG-encrypted. There's not much netrc-specific though, so it might be worth trying with the plstore backend if that's what you prefer. Thomas