This isn’t really a Python issue, but I’m not sure where to ask. The various Google communities I’ve consulted have all been useless.
I have a Python app which used to use an app password to connect to Gmail via imaplib
. This program runs in the background, but just today I noticed that it can no longer connect:
2024-12-24 15:21:01,571 DEBUG > b'XXXXX LOGIN **REDACTED**
2024-12-24 15:21:02,602 DEBUG < b'XXXXX NO [AUTHENTICATIONFAILED] Invalid credentials (Failure)'
...
2024-12-24 15:21:02,604 ERROR login failed. check your credentials.
2024-12-24 15:21:02,604 ERROR Exiting read loop early
The ERROR messages are coming from my program, the DEBUG messages from the IMAP chit chat. Looking through my logs, this started happening in early November. Before that, it had been working fine for over two years.
I couldn’t figure out why my app password was no longer working, though in poking around my Google account, I suspect it has something to do with enabling passkeys. I can’t find two-factor authentication anywhere in my account. Is there some other way for background applications (no GUI) to use IMAP to connect to GMail?