From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Xiyue Deng Newsgroups: gmane.emacs.bugs Subject: bug#72358: 29.4; oauth2.el improvements Date: Tue, 30 Jul 2024 12:44:40 -0700 Message-ID: <871q3a8y1j.fsf@debian-hx90.lan> References: <87mslz8yzk.fsf@debian-hx90.lan> <9717.00003590144$1722349291@news.gmane.org> <87r0bbvt9d.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38188"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?Q?Bj=C3=B6rn?= Bidar , 72358@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 30 21:47:01 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sYsoH-0009lj-5W for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Jul 2024 21:47:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYso5-0004FH-T9; Tue, 30 Jul 2024 15:46:49 -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 1sYso4-0004F5-Iu for bug-gnu-emacs@gnu.org; Tue, 30 Jul 2024 15:46:48 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sYso4-00065F-97 for bug-gnu-emacs@gnu.org; Tue, 30 Jul 2024 15:46:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=29wfx/5jpk2MgSipDSGSXo7A8kK3yG0+wne0bE6TcrA=; b=fcoLVFgCtCrAn3kTsnddzPiC499P62oM1hqU+xNfl15xJTA7PBh2tm30ARE1JVGBU38WSEUU8tYj7midGvDqnE7BHjU5eZu6qK8gDKPZNlu+tYaSwlArJ3FItOUL5wb3SSBIVrcqZu9CWg3n5nd7EQd19RtBS61jniiF9bV+jwPn6ZkhJ6Yup6avVJQVJ9s9DyYm6cvuwpr3NudZ2vsyJC4oN23dY79ZbA37uUIMUcEcVYjMxXnhRuzxpADB/0YfjOlNHl+5v/1mgbRzs+GmzmXODckXyO5V8tBLDl86cc2sCx+8caXYLFhlRS966sCERqOjZ0H5xZIIYvjKOBrpPw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sYsoH-0006MZ-Or for bug-gnu-emacs@gnu.org; Tue, 30 Jul 2024 15:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Xiyue Deng Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Jul 2024 19:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72358 X-GNU-PR-Package: emacs Original-Received: via spool by 72358-submit@debbugs.gnu.org id=B72358.172236876424330 (code B ref 72358); Tue, 30 Jul 2024 19:47:01 +0000 Original-Received: (at 72358) by debbugs.gnu.org; 30 Jul 2024 19:46:04 +0000 Original-Received: from localhost ([127.0.0.1]:48411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sYsnM-0006KJ-1f for submit@debbugs.gnu.org; Tue, 30 Jul 2024 15:46:04 -0400 Original-Received: from mail-pf1-f180.google.com ([209.85.210.180]:42287) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sYsnK-0006JY-Ou for 72358@debbugs.gnu.org; Tue, 30 Jul 2024 15:46:03 -0400 Original-Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-70d18112b60so179635b3a.1 for <72358@debbugs.gnu.org>; Tue, 30 Jul 2024 12:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722368682; x=1722973482; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=29wfx/5jpk2MgSipDSGSXo7A8kK3yG0+wne0bE6TcrA=; b=KYtH7M8xcZ5rli8STlqL0i5vsGnzfKfmpzbeRXlwazYtiFKfVJvz5YxPyX6ZXgjCmo szxROGY4f/Y0uOEJekN013hiX1mt44C9IIigbD4JZOjs+IpoV/BJuRDvW4U6cVfF3dDy +gqLlqFn0Y9SzMnLaLRGGKbuCf/Rm2xH9ckTWdvQL8wQouWr7CMolNL+1CNxJvN6OqFw sqY0+z6uLRgsTHW3J9VV/MCNDfxFRe8tYDURUiNakxaMprXqVzldY2UMPDlN8NBnQT/e hCy//rQ1so4Yt3bIBXgYQE7I1+emlLgmgPticr/dIGpMUcxW4RzGaOyqnvJMATdqKfRq 5Nlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722368682; x=1722973482; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=29wfx/5jpk2MgSipDSGSXo7A8kK3yG0+wne0bE6TcrA=; b=SKEOTK72ZiEDo2ijBp4VQ+mAt29SDZ6574i0CabFqKCRlYqzx3tLoyBjgb2uu5Ozvf aTXsh02uFhtZ96sPJsV1CPvn/rrOeNPirPIKM2jtKEk4QAs/v9NROHNGaT7JRSuPKWlP FH5jdrlO4vgCd7ml31ifxLR4yiTXg0ll//WDB4PVeth5yxYdQBg8Rmwdem4ALZwheA80 6pcvZ2i2N6+JEOSIoAsVQzTx7WUp3HdywfnPa6z17NGwO4va57YoHDK3yXjdawla0FvG hjKQjYA+hebCoRBbKj6lkxOdM21SkdgiXpffXSwpweAJtB0z1wmaQ9Qvhp1o7woIpp9o SViQ== X-Forwarded-Encrypted: i=1; AJvYcCXvQZavcMWymeX8V2ioN1IqFXNyvwi44NaD9VfTWAuFHjFngOKzFybuTqVYsyqznTi5d/7U6fF9lIRCY5A3hXiyzR+rtvc= X-Gm-Message-State: AOJu0YyojgTANfdHTs73nO0iYvE4QNwk1pAtc5CNTrS+o5PSA4rmqdzS iEZmreTfduJ+1evZ4WbNQpmwJsOTLBo0mXR3yeQRLPA5qM7ETdSgcVLbQBbY X-Google-Smtp-Source: AGHT+IEJLA02ZTDdSZeiBHJvmYUFNK4qe6TUm1jdOck0FWDEhSu5N+esfPQrhjFc4j0qoEbAF/Niqg== X-Received: by 2002:a05:6a20:7f8e:b0:1c4:83f4:356 with SMTP id adf61e73a8af0-1c4e4853b79mr4993074637.18.1722368682261; Tue, 30 Jul 2024 12:44:42 -0700 (PDT) Original-Received: from debian-hx90 (syn-104-172-240-218.res.spectrum.com. [104.172.240.218]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7a9fa5a0bcesm7942475a12.89.2024.07.30.12.44.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 12:44:41 -0700 (PDT) In-Reply-To: <87r0bbvt9d.fsf@gmail.com> (Robert Pluim's message of "Tue, 30 Jul 2024 16:39:26 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289562 Archived-At: Robert Pluim writes: >>>>>> On Tue, 30 Jul 2024 17:08:21 +0300, Bj=C3=B6rn Bidar via "Bug report= s for GNU Emacs, the Swiss army knife of text editors" said: > > Bj=C3=B6rn> Xiyue Deng writes: > >> The fourth patch may need a bit of background: oauth2.el (optional= ly) > >> 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 Gm= ail, > >> the three parameters are the same for different accounts, and hence > >> storing a second account information will override the first one. > > Bj=C3=B6rn> Would it make sense to plug OAuth2.el into auth-source to= store the > Bj=C3=B6rn> authentication token safely inside an existing credential= storage? > > Bj=C3=B6rn> Various applications already do so when using the native = credential > Bj=C3=B6rn> storages such as Freedesktop.org or the macOS keyring. > > Yes. In fact there=CA=BCs the auth-source-xoauth2 package that does > that. And oauth2 can already store stuff using plstore, so I=CA=BCm 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. > > Robert --=20 Xiyue Deng