Subject: bug#78366: 30.1; auth-source-xoauth2-plugin conflicts with multiple Google accounts

From: Xiyue Deng <[email-masked]>
Date: Sat, 10 May 2025 20:36:25 -0700

Hi Anush,

Anush V <[email-masked]> writes:

> Hello Emacs maintainers,
>
> I have two google mail accounts, the first one uses app passwords to
> authenticate, and the other uses oauth (because it doesn't support app
> passwords)
>
> When I enable auth-source-xoauth2-plugin-mode, I’m able to send email
> from second account without any issues.  But i’m unable to send emails
> from the first account.  When I disable auth-source-xoauth2-plugin i’m
> able to send email from the first account.
>
> I think that enabling xoauth2 shouldn't interfere with other
> authentication methods, so this could be a bug.
>
> Thank you for your time
>
> * * *
>
> In GNU Emacs 30.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43,
> cairo version 1.18.2)
> System Description: Guix System
>
> Configured using:
>  'configure
>  CONFIG_SHELL=/gnu/store/m0xdsa8cfq6mq1kxgxmpmpg71la4f0b9-bash-minimal-5.1.16/bin/bash
>  SHELL=/gnu/store/m0xdsa8cfq6mq1kxgxmpmpg71la4f0b9-bash-minimal-5.1.16/bin/bash --prefix=/gnu/store/lq0nwm8qkj9cmyjm85z3dcqrjnglhcym-emacs-next-pgtk-30.1-rc1-2.7144e84 --enable-fast-install --with-pgtk --with-cairo --with-modules --with-native-compilation=aot --disable-build-details'
>
> --
> Regards,
> Anush
>
>

Thanks for your report!  Ideally auth-source-xoauth2-plugin should only
be in effect when your auth-source entry has "auth" set to "xoauth2".
Can you check whether you happen to set that for your auth-source entry
for the account using app password?  Sharing your auth-source entries
with your personal information removed would be helpful.

It would also help to share some of the error logs following instruction
in the "Debugging" section in README.org[1].  Please be careful not to
share any personal information from the logs.

[1] https://gitlab.com/manphiz/auth-source-xoauth2-plugin/-/blob/main/README.org?ref_type=heads

-- 
Regards,
Xiyue Deng