A toolkit for handling OAuth with Django Rest Framework
Project description
DRF OAuth Toolkit
drf-oauth-toolkit is a flexible OAuth2 integration library for Django Rest Framework (DRF).
Features
- Plug-and-play OAuth2 integration for DRF
- Supports multiple OAuth providers
- Built-in token management and CSRF protection
Installation
pip install drf-oauth-toolkit
Usage
- Add
drf_oauth_toolkittoINSTALLED_APPSin yoursettings.py. - Configure OAuth credentials in your Django settings.
- Import and extend the base
OAuthServiceBaseclass for your desired OAuth provider.
from drf_oauth_toolkit.services.base import OAuthServiceBase
class GoogleOAuthService(OAuthServiceBase):
API_URI_NAME = "google_redirect"
AUTHORIZATION_URL = "https://accounts.google.com/o/oauth2/auth"
TOKEN_URL = "https://oauth2.googleapis.com/token"
USER_INFO_URL = "https://www.googleapis.com/oauth2/v3/userinfo"
SCOPES = ["openid", "email", "profile"]
Running Tests
pytest
Contributing
Pull requests are welcome. For major changes, please open an issue first.
License
MIT License. See LICENSE for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file drf_oauth_toolkit-0.1.0.tar.gz.
File metadata
- Download URL: drf_oauth_toolkit-0.1.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.13.1 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e415c4bebaf6ae245d376dc0fc9d96efed08bb3715ed2f6a6042114243d5f71e
|
|
| MD5 |
569f2b176777559233ca65da6d209df1
|
|
| BLAKE2b-256 |
f882cae81858c2245dfaf97ea69b84bba5a60250d05ab78e866c06290107fa7f
|
File details
Details for the file drf_oauth_toolkit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: drf_oauth_toolkit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.13.1 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddd46fa18f76c54a0a1bdfe635473b030867184fb75f0620f6c2565ae40d4c2c
|
|
| MD5 |
6918f34a76dc20503a6ad683fbacaeb1
|
|
| BLAKE2b-256 |
be6f56ba1f7b8f42e0b315493f8bb6479de9d0af86d5dd2aca07215075758703
|