Metadata-Version: 2.1
Name: drf-oauth-toolkit
Version: 0.1.0
Summary: A toolkit for handling OAuth with Django Rest Framework
License: MIT
Author: Basel Mahmoud
Author-email: basel.mahmoud@arkleap.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: attrs (>=24.3.0,<25.0.0)
Requires-Dist: django (>=5.1.4,<6.0.0)
Requires-Dist: djangorestframework (>=3.15.2,<4.0.0)
Requires-Dist: djangorestframework-simplejwt (>=5.4.0,<6.0.0)
Requires-Dist: oauthlib (>=3.2.2,<4.0.0)
Requires-Dist: pyjwt (>=2.10.1,<3.0.0)
Requires-Dist: requests (>=2.32.3,<3.0.0)
Requires-Dist: types-requests (>=2.32.0.20241016,<3.0.0.0)
Description-Content-Type: text/markdown


# 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
```bash
pip install drf-oauth-toolkit
```

## Usage
1. Add `drf_oauth_toolkit` to `INSTALLED_APPS` in your `settings.py`.
2. Configure OAuth credentials in your Django settings.
3. Import and extend the base `OAuthServiceBase` class for your desired OAuth provider.

```python
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
```bash
pytest
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first.

## License
MIT License. See `LICENSE` for more information.


