Skip to content

Connecting to Gmail using OAuth2 #220

@cpbl

Description

@cpbl

I've been relying on offlinemap for >20 years.
A month ago my offlineimap connection to gmail stopped working with
ERROR: All authentication types failed:
PLAIN: b'[AUTHENTICATIONFAILED] Invalid credentials (Failure)'

I cannot find up to date instructions for using gmail via imap in offlineimap, especially since the March 2025 changes for gmail authentication.

To try to set up OAuth2 which it looks like I might not have been using, I have:

  • registered a new application and got OAuth credentials, by:

Log in to the Google Cloud Console, create a new project (if needed), and enable the Gmail API.
Navigate to "APIs & Services" -> "Credentials" and create a new OAuth 2.0 client ID.
Choose "Web application" as the application type, and enter an application name.
Configure the consent screen by adding users and specifying the allowed domains, if applicable.

But putting these into oflfineimap seems not to help.
Is there clear documentation / use case written up for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions