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.devel Subject: Re: Potential bug/inconsistency in auth-source netrc vs plstore backends Date: Fri, 08 Nov 2024 14:11:43 -0800 Message-ID: <87fro1s7ds.fsf@debian-hx90.lan> References: <87h68idspm.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36530"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.38.3 (https://notmuchmail.org) Emacs/29.4 (x86_64-pc-linux-gnu) Cc: emacs-devel To: Soham Gumaste , Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 08 23:12:34 2024 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 1t9XDV-0009MO-Ji for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Nov 2024 23:12:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9XCq-00088y-Q5; Fri, 08 Nov 2024 17:11:52 -0500 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 1t9XCo-00088U-CT for emacs-devel@gnu.org; Fri, 08 Nov 2024 17:11:50 -0500 Original-Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t9XCm-0006wG-Qk for emacs-devel@gnu.org; Fri, 08 Nov 2024 17:11:50 -0500 Original-Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-71e5a62031aso2213267b3a.1 for ; Fri, 08 Nov 2024 14:11:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731103907; x=1731708707; darn=gnu.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=+FgcjxHaskk6hppZPJSwwa9aplesPvCHXa54384Rkmk=; b=AaZg8A+BGy/6YjbyB6ceqLtxZFL0KzvFR83D/nKchchmm1D9KTbFWO5JuQdcZj3E2c O8alDcUP56QmY9iDII0uM+tHRvFJJETj/7nsIjZmCjE9iHSaiy+9cqS+TOcbjUxKRmuu 2soRShn1Yu3yes1R45WBCr6qOI++AHTcBlX1DfNS/+TgHdPIVj+2ZKRMdhzzm+SRug1h OxwveAOHVXhLxx5tEU4kCkUMMjUxJKiJlKLk7GkgRUiS03eJVBAjDodfXe6hLCfSMZV4 9IV5Ipz1oqlpN95WMxa7LOS2AB9tIrSlIK6iYuIpr+cJyjXZp/R1EQ01XOtb9P8Q7wSi kEOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731103907; x=1731708707; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+FgcjxHaskk6hppZPJSwwa9aplesPvCHXa54384Rkmk=; b=cvRpYJzUSgNwwDDI3bf8DF+intxAKjfgfIgk2/BDDQvW4PujdYcdb+8qCp/c9idGLp KbvQpUIk1OhJjUicDRIKnSG5LOzISN8fVcKvTXyidm+X95pdibD76iVyVq+g33JU6OIf FEOaw5d0a8JLplRTvXKgjvgPTJlxI8xTMETa6WEiV0VUEm9AEyzpu7mK48tjJp8nlDyg lkm4s6n/talkp9FCyoTtupt6RX+DZrj43clCWNCcYHARL795z5ZNOZQ/iyzdsKy+F/H6 0BtPAj8Yqd65YKGVehchSKv4JTjJ56mIsalJ18KJdkB+Hm35A2+kP9IWGTkFysokR8pq hTYg== X-Gm-Message-State: AOJu0YwvpJFxzUDbiM7csuGBJESZlp8fbFpCgdS1H+PenQIK6ismYBw3 IGGi+7NFpjbFjI2Ah1H+7kPE7dTquMZvIQggrYJDVe4p/qdWxqtWalsigQ== X-Google-Smtp-Source: AGHT+IHhWrIGbd4oArJb5iV4AfnTR3+tX1rO6SBSqfbFL3SguvLXkdyx6wFps1MMsSQZurCvyIwkhA== X-Received: by 2002:a05:6a00:21cc:b0:71e:3b51:e850 with SMTP id d2e1a72fcca58-724132788c8mr5760760b3a.2.1731103906661; Fri, 08 Nov 2024 14:11:46 -0800 (PST) Original-Received: from debian-hx90 (syn-076-094-249-045.res.spectrum.com. [76.94.249.45]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7f41f65fd7asm3991898a12.83.2024.11.08.14.11.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 14:11:46 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=manphiz@gmail.com; helo=mail-pf1-x436.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, 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.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:325314 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Soham Gumaste writes: >> > Hello, >> >> Hi Soham, > > Hello, thanks for your time. > >> What about using a fixed port like ':port "token"'? A similar (mis-)use >> of :port is used by Tramp, where the port keeps the connection method, >> like ':port "ssh"'. >> > Well, I am trying to satisfy the auth-sources-search query in the > function nnimap-credentials in nnimap.el. That query requests the > :port in the spec, and for the query to succeed with the plstore > backend I need to exactly match the :port attribute in the plist saved > by oauth2.el. This would mean I would have to store every port the > user wants to use oauth creds with. Regardless, I still want to know > if the discrepancy between the netrc and plstore backend is > intentional or if I can patch it. > I think that's how auth-source is supposed to work. People would need 2 entries with different `:port's, one for imap(s), one for smtp, for both to work. Or maybe there is a better way now? >> This is documented in the auth manual, at the bottom of (info "(auth) >> Help for users") . A simiar solution for oauth2.el could be documented >> there as well. >> > My current workaround is to advise the nnimap-credentials with :around > mode and returning the oauth2 token when appropriate. I'd like to make > this more first class though. It could be done by simply tweaking the > plist file stored by oauth2.el but the aforementioned discrepancy is > the roadblock right now. I dare not try to edit anything in Gnus > itself. I think smtpmail uses the `:smtp-auth' attribute to specify which mechanism to use[1]. In my plugin[2] I'm using `:auth' in a similar fashion. This has the advantage that one can have both the password and XOAuth2 credentials in auth-source and can choose which to use simply by changing `:auth', though this also requires coordination from nnimap[3]. Ideally I think it would be helpful if one can directly request which mechanism to use in auth-source. For now this has to be done explicitly, e.g. in nnimap using `(nnimap-authenticator xoauth2)'. If that's not set, there can be a default sequence of authentication mechanisms to try, like what nnimap is doing now, but put xoauth2 in higher priority. >> > Thanks >> >> Best regards, Michael. > > Thanks > > --=20 > Soham Gumaste > sohamg2@gmail.com > [1] https://www.gnu.org/software/emacs/manual/html_node/smtpmail/Authentica= tion.html [2] https://gitlab.com/xiyueden/auth-source-xoauth2-plugin/-/blob/main/auth= -source-xoauth2-plugin.el?ref_type=3Dheads#L106-107 [3] https://gitlab.com/xiyueden/auth-source-xoauth2-plugin/-/blob/main/auth= -source-xoauth2-plugin.el?ref_type=3Dheads#L48 =2D-=20 Regards, Xiyue Deng --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJGBAEBCgAwFiEEiKQfd6o81mjI+LWALell7WOCXJMFAmcujJ8SHG1hbnBoaXpA Z21haWwuY29tAAoJEC3pZe1jglyTp7wQAJeHSrgFdesIgKxLJWqKzJaLLgJshcqz E7Y+qTVNi2xJIUBbtw8wJdMrbUYZ+o36LYkAAfAXFAo3WWa9C89nm5VpeUFua6kk 7RWGQLtWzqTGA9sIiYnek5THhyR8r56TVRUEQF03SSirhoPY0ANSlUCe/qv4fIYJ 57+EYsqtTRkQYVyEbfq00dkfBCLX2YD43YnJVzmprEGqD4ybhFw2/DYxMp8THflf RcKaPnUiPr/qhOrFUpUbpajzWqRhLkRHUf0qv4CldeQwm2vufB//f5mFdVLz6JJx gSKbdGzdCkX9bEeckJhmRINEu5+xbH1H4byHlAlzgSTEUlIvthXTcoAKi6Xy+cx3 1DJOsPBu1QHnkWK6SaZMda3ZhCnXEd2X+Z5jGCKrNnAsci92KY5cNecvMXyiUNHN 9KSZVoLjpIZzrH2Kv7Ps2NloxWgMSJBPLQs2l6YWKw68SJJV96EMWZbwC+Tz01/B JIuma0aJiPV6KuUcuE1+Q5AuSROGqXffmtXZCiEAfjmktHUm8z5H0Zl8HZLzh/zY uwgYKE5Mp5b78h1f5T3DsApFQZuUOa4VXEO7NnVoBBfcp7NEz4b721/0LSoV7bTb oke2LJGeM/7eZz8YFQT/zY2SUp2eOYkprPsFvP4higX7WIXZ8sFhXQqmj7XiZil1 E/Br6NdvEyRU =Fe07 -----END PGP SIGNATURE----- --=-=-=--