by matt08s on 5/13/2025, 2:01:57 PM
I like this! I’m currently working on a Django project and was wondering whether oauth2 capture could be used for it.
I’ll need user A (freelancer) to get access to certain providers accounts (eg Google) of user B (client), and user B to grant user A privileges to user B‘s provider account.
So, for example, freelancer asks client to get admin access to their Google analytics account and my app is the intermediary letting this transaction happen. Would this be possible with oauth2_capture?
I've created oauth2_capture (https://github.com/heysamtexas/django-oauth2-capture/), a Django package that makes it easy to capture, store, and refresh OAuth2 tokens from multiple providers.
The package currently supports Twitter/X, LinkedIn, GitHub, Reddit, Pinterest, and Facebook, with more providers planned. It handles the entire OAuth2 flow, from authorization to token storage and automatic refreshing.
Key technical features:
I built this because I kept reimplementing OAuth2 flows in different projects and wanted a reusable solution. The package is designed to be easily extended to support additional providers.I'd love feedback from the community on the API design, code quality, or additional features that would be useful.
Yes, Allauth does a great job of oauth and user signups/management. This is not that.
When to use oauth2_capture
Choose oauth2_capture when your application needs to:
Choose django-allauth when you primarily need: Can they be used together?Absolutely! You can use django-allauth for user authentication and oauth2_capture for API interactions. They solve different problems and complement each other well.
Simply put: django-allauth manages users, oauth2_capture manages tokens.