all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xiyue Deng <manphiz@gmail.com>
To: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Cc: "Björn Bidar" <bjorn.bidar@thaodan.de>,
	"Robert Pluim" <rpluim@gmail.com>,
	72358@debbugs.gnu.org
Subject: bug#72358: 29.4; oauth2.el improvements
Date: Fri, 02 Aug 2024 01:09:55 -0700	[thread overview]
Message-ID: <87y15f4a7g.fsf@debian-hx90.lan> (raw)
In-Reply-To: <m3zfpwulgy.fsf@fitzsim.org> (Thomas Fitzsimmons's message of "Thu, 01 Aug 2024 14:49:49 -0400")

Hi Thomas,

Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:

> Xiyue Deng <manphiz@gmail.com> writes:
>
>> Robert Pluim <rpluim@gmail.com> writes:
>>
>>>>>>>> On Tue, 30 Jul 2024 17:08:21 +0300, Björn Bidar via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> said:
>>>
>>>     Björn> Xiyue Deng <manphiz@gmail.com> writes:
>>>     >> The fourth patch may need a bit of background: oauth2.el (optionally)
>>>     >> uses plstore to save authentication data for future reuse, and the
>>>     >> plstore id for an account is computed using a combination of `auth-url',
>>>     >> `token-url', and `scope'.  However, this combination of data doesn't
>>>     >> guarantee uniqueness for accounts for a same provider, e.g. for Gmail,
>>>     >> the three parameters are the same for different accounts, and hence
>>>     >> storing a second account information will override the first one.
>>>
>>>     Björn> Would it make sense to plug OAuth2.el into auth-source to store the
>>>     Björn> authentication token safely inside an existing credential storage?
>>>
>>>     Björn> Various applications already do so when using the native credential
>>>     Björn> storages such as Freedesktop.org or the macOS keyring.
>>>
>>> Yes. In fact thereʼs the auth-source-xoauth2 package that does
>>> that. And oauth2 can already store stuff using plstore, so Iʼm sure it
>>> can be extended to use auth-source.
>>>
>>
>> auth-source-xoauth2 doesn't actually use auth-source
>> (e.g. ~/.authinfo.gpg) to store the data it needs, but use a custom file
>> storing an ELisp hash table to store the client-id, client-secret, etc.
>> It does advice the authentication code to use the calculated token.
>
> I have not seen it mentioned in this thread yet, so here goes: my
> url-http-oauth package in GNU ELPA supports storing credentials in
> ~/.authinfo.gpg and refreshing them.  It would be nice if your OAuth2
> work could get feature parity with it, then I could delete my package;
> feel free to copy any code that makes sense.  (I do not use
> url-http-oauth anymore, but I felt the need to write it when I was using
> Excorporate and OAuth.)
>

Thanks for working on url-http-oauth!  I think it adds credential
management using auth-source, e.g. prompt for client-id and
client-secret and store them, which my other addon (that I'll post next
as it depends on the changes I made here) didn't do.  Ideally this
should be handled transparently by all auth-source backends and say Gnus
when you add a new account, but IIUC currently the JSON backend doesn't
support creation, which I'm using for ease to read and modify.

> Ideally you could get the result (and the xoauth2 support for IMAP and
> SMTP) accepted in Emacs core.
>

That would be great!  My other addon uses advice, but it would
definitely be better to be integrated in core (which already has partial
support)

> (Then, extremely ideally, the FSF could work out legal agreements with
> the various OAuth providers to get Emacs registered as an OAuth
> application, like, e.g., Thunderbird.)
>

That would be the best for the end user.  Imagine a Gnus user could just
add a new account and on launch Gnus the default browser will open the
login page (or be prompted an URL to visit), which then normally handles
all the login shenanigans (2FA, authenticator, etc.) and viola, you're
logged in.

> Thomas

-- 
Xiyue Deng





  reply	other threads:[~2024-08-02  8:09 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 21:25 bug#72358: 29.4; oauth2.el improvements Xiyue Deng
2024-07-30  7:46 ` Robert Pluim
2024-07-30 14:05   ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-30 19:37   ` Xiyue Deng
2024-07-31  8:54     ` Robert Pluim
2024-07-31 11:13       ` Xiyue Deng
2024-08-02  8:15         ` Xiyue Deng
2024-08-02  8:38           ` Robert Pluim
2024-08-03  0:04             ` Xiyue Deng
2024-08-03  5:52           ` Eli Zaretskii
2024-08-03  9:26             ` Xiyue Deng
2024-08-13 22:03             ` Xiyue Deng
2024-08-14  5:28               ` Eli Zaretskii
2024-08-14  8:23                 ` Xiyue Deng
2024-08-14  8:40                   ` Xiyue Deng
2024-08-14  9:13                   ` Eli Zaretskii
2024-08-21 18:22                     ` Xiyue Deng
2024-08-21 19:42                       ` Philip Kaludercic
2024-08-21 22:11                         ` Xiyue Deng
2024-08-29  6:58                           ` Xiyue Deng
2024-08-29 14:14                           ` Philip Kaludercic
2024-08-29 15:18                             ` Robert Pluim
2024-08-29 23:54                             ` Xiyue Deng
2024-08-30  7:09                               ` Philip Kaludercic
2024-08-30  8:32                                 ` Xiyue Deng
2024-08-30 10:07                                   ` Philip Kaludercic
2024-08-30 21:13                                     ` Xiyue Deng
2024-09-03 18:08                                       ` Xiyue Deng
     [not found]   ` <66a8f323.170a0220.9172c.8e28SMTPIN_ADDED_BROKEN@mx.google.com>
2024-07-30 19:40     ` Xiyue Deng
2024-07-30 21:50       ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-07 23:22       ` Xiyue Deng
2024-08-08  6:11         ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-08  6:14         ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]         ` <66b46180.170a0220.1fb02.1d6eSMTPIN_ADDED_BROKEN@mx.google.com>
2024-08-08  8:28           ` Xiyue Deng
2024-08-08  9:17             ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-12 13:22             ` Thomas Fitzsimmons
2024-08-12 16:26               ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]         ` <66b46251.170a0220.f2be9.afeeSMTPIN_ADDED_BROKEN@mx.google.com>
2024-08-08  8:29           ` Xiyue Deng
2024-08-08  9:31             ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-30 14:08 ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-30 14:39   ` Robert Pluim
2024-07-30 19:44     ` Xiyue Deng
2024-08-01 18:49       ` Thomas Fitzsimmons
2024-08-02  8:09         ` Xiyue Deng [this message]
2024-08-02 14:43           ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found] ` <66a8f3d6.050a0220.8facb.d530SMTPIN_ADDED_BROKEN@mx.google.com>
2024-07-30 19:41   ` Xiyue Deng
2024-07-30 21:51     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]     ` <66a96079.170a0220.1522dd.3e68SMTPIN_ADDED_BROKEN@mx.google.com>
2024-07-31  7:43       ` Xiyue Deng
2024-07-31 23:53 ` Andrew Cohen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y15f4a7g.fsf@debian-hx90.lan \
    --to=manphiz@gmail.com \
    --cc=72358@debbugs.gnu.org \
    --cc=bjorn.bidar@thaodan.de \
    --cc=fitzsim@fitzsim.org \
    --cc=rpluim@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.