{"id":48469496,"url":"https://github.com/tharvik/oauth2-front","last_synced_at":"2026-04-07T06:01:54.814Z","repository":{"id":341884890,"uuid":"1089791306","full_name":"tharvik/oauth2-front","owner":"tharvik","description":"proxy to mimick tunderbird to an oauth2 provider","archived":false,"fork":false,"pushed_at":"2026-03-03T18:35:12.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-03T22:20:09.018Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tharvik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-04T20:21:05.000Z","updated_at":"2026-03-03T18:35:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tharvik/oauth2-front","commit_stats":null,"previous_names":["tharvik/oauth2-front"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/tharvik/oauth2-front","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tharvik%2Foauth2-front","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tharvik%2Foauth2-front/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tharvik%2Foauth2-front/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tharvik%2Foauth2-front/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tharvik","download_url":"https://codeload.github.com/tharvik/oauth2-front/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tharvik%2Foauth2-front/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31501903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-07T06:01:54.242Z","updated_at":"2026-04-07T06:01:54.788Z","avatar_url":"https://github.com/tharvik.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Does your local OAuth2 provider only support thunderbird?\nNow you can mimick thunderbird client_id with this auth proxy.\n\nThis rust proxy needs a WebDriver proxy running locally (on the standard port 4444) to be able to control a web browser to make the OAuth2 token requests in your name (you will need to log in)\n * I used [geckodriver](https://firefox-source-docs.mozilla.org/testing/geckodriver/) for that\n\n# Howto\nInstall and run the geckodriver WebDriver for firefox (leave it running):\n```bash\ncargo install geckodriver # If it complains about you .cargo/bin/ not being on PATH, then run it directly, i.e., ~/.cargo/bin/geckodriver\ngeckodriver --port 4444 --log debug --binary path/to/firefox/firefox-bin\n```\n\nRun the proxy from this folder with:\n```bash\ncargo run Cargo.toml\n```\n\n# Configuration\n\nWith these two running, on a non-claws-mail client, you can now set the proxy (http://localhost:1312) as your auth server.\nit forwards everything to upstream expect for `client_id` and `redirect_uri`.\n\nThe proxy offers two routes\n * `/authorize` for getting the authorization code\n * `/exchange` for exchanging the authorization code for a long term token\n * `/token` for exchanging the long term token for a session one\n\n\n# Configuration for claws-mail\nUnfortunately, the wonderful claws-mail only has some hardcoded oauth2 servers.\n\nLet's patch the release claws-mail:\n```bash\n# Please clone claws-mail somwhere OUTSIDE this repo\ngit clone --depth 1 --branch 4.3.1 git://git.claws-mail.org/claws.git\ncd claws\n\n# Patch 1\n# Now get the OAuth2 patch from claws-mail\ncurl https://git.claws-mail.org/\\?p\\=claws.git\\;a\\=patch\\;h\\=28b2c38a9b25f611f844202ba785fa4c9588768e\\;hp\\=41cbf87342cba1333deb76b1fa9443604a88a83a \u003e OAuth2.patch\n# copy in ./claws-mail.patch\n# Apply it (ignore whitespace errors)\ngit apply OAuth2.patch\n\n# Patch 2\n# copy ./claws-mail.patch from this repository to claws, let's apply it\ngit apply claws-mail.patch\n\n# Compile as per usual\n# apt install libgdk-pixbuf-2.0-dev libgtk-3-dev libetpan-dev bison flex autopoint gettext\n./autoconf\nmake\nsudo make install\n```\n\nNow to configure claws-mail:\n  - Configure → Create new account\n  - IMAP account. Your user name is your email, don't put password.\n    The IMAP and SMTP servers are the normal ones.\n  - In auth for IMAP and SMTP put OAuth2.\n  - On the OAuth2 page, select \"EPFL\" (leave client id and secret blank) and press [open default browser with request]\n  - This will make a request to the proxy (which open a localhost:1312), who will then use the geckodriver to open a window where you should log in\n  - After logging in a \"Unable to connect\" flashes up (this is OK). There should be a window waiting saying OAuth was imported successfully into claws-mail. You can close it.\n  - If successful, you will find your password filled in, well done!\n\n# Configuration for aerc\n\nThe account configurations looks like\n\n```\n[$account-name]\nsource             = imaps+xoauth2://$email@outlook.office365.com:993?token_endpoint=http://localhost:1312/token\nsource-cred-cmd    = echo $your-refresh-token\noutgoing           = smtp+xoauth2://$email@smtp.office365.com:587?token_endpoint=http://localhost:1312/token\noutgoing-cred-cmd  = echo $your-refresh-token\n```\n\nYou can generate the refresh token by first getting an authorize code and then exchanging it for a long-term/refresh token.\nAfter starting the proxy, go to http://localhost:1312/authorize?redirect_uri=http://localhost:1312/exchange to generate it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftharvik%2Foauth2-front","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftharvik%2Foauth2-front","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftharvik%2Foauth2-front/lists"}