auth-source-xoauth2 icon indicating copy to clipboard operation
auth-source-xoauth2 copied to clipboard

NO [AUTHENTICATIONFAILED] Invalid credentials (Failure)

Open pauljarc opened this issue 2 years ago • 1 comments

I'm trying to set up auth-source-xoauth2, and I get this error in the nnimap buffer when I try to connect to GMail:

NO [AUTHENTICATIONFAILED] Invalid credentials (Failure)

I managed to resolve all the previous problems up to now, but I don't know how to investigate further. So far, I created a Google project, generated a refresh token, and recorded the necessary information, encrypted and signed, in ~/.password-store/[email protected]:993.gpg:

$PASSWORD
xoauth2_token_url: https://accounts.google.com/o/oauth2/token
xoauth2_client_id: $ID
xoauth2_client_secret: $SECRET
xoauth2_refresh_token: $TOKEN

My .emacs has:

(require 'auth-source-xoauth2)
(require 'epa-file)
(epa-file-enable)
(setq auth-source-xoauth2-creds 'auth-source-xoauth2-pass-creds)
(add-to-list 'auth-sources 'password-store)
(auth-source-xoauth2-enable)

Gnus can connect to GMail for one of my accounts, on a Google Apps domain where plain password authentication is still enabled. But connecting to my gmail.com account gives the above error. Any ideas?

pauljarc avatar Oct 15 '22 09:10 pauljarc

You can set auth-source-debug and nnimap-record-commands to t, to investigate. Btw have you added (nnimap-authenticator xoauth2) to your nnimap config? Also see the issue I posted earlier, if you're using Emacs 28.

quotuva avatar Mar 15 '23 23:03 quotuva