Is OAuth2 authentication working?

Nasser Alkmim <[email protected]> Thu, 26 Mar 2026 07:11:50 +0100
Newsgroups gmane.emacs.gnus.general
Message-ID <[email protected]>
Hi,

I want to set up an IMAP server from outlook.office365.com with two=E2=80=
=91factor
authentication using the OAuth2 method.

I can set it up in Thunderbird, which opens a browser window for
authentication.

In the Gnus manual, there is this instruction:

    =E2=80=98nnimap-authenticator=E2=80=99
         Some IMAP servers allow anonymous logins.  In that case, this
         should be set to =E2=80=98anonymous=E2=80=99.  If this variable is=
n't set, the
         normal login methods will be used.  If you wish to specify a
         specific login method to be used, you can set this variable to
         either =E2=80=98login=E2=80=99 (the traditional IMAP login method)=
, =E2=80=98plain=E2=80=99,
         =E2=80=98cram-md5=E2=80=99 or =E2=80=98xoauth2=E2=80=99.  (The lat=
ter method requires using the
         =E2=80=98oauth2.el=E2=80=99 library.)

So I tried in my init.el:

    (setq gnus-secondary-select-methods
          '((nnimap "outlook"
                    (nnimap-address "outlook.office365.com")
                    (nnimap-authenticator 'xoauth2))))

I also load:

    (require 'oauth2)

But it does not work. Are there any more instructions on using this
authentication method?

Thunderbird may have some predefined settings that make it work out=E2=80=
=91of=E2=80=91the=E2=80=91box.

--=20
Nasser Alkmim