Skip to main content

MIT Open Learning django app extensions for oauth toolkit

Project description

mitol-django-oauth-toolkit-extensions

This is the Open Learning's extensions to django-oauth-toolkit.

Getting started

pip install mitol-django-oauth-toolkit-extensions

Configuration

Add the following to settings.py:

INSTALLED_APPS = [
    ...
    "mitol.oauth_toolkit_extensions.apps.OAuthToolkitExtensionsApp",
]

# required for migrations
OAUTH2_PROVIDER_ACCESS_TOKEN_MODEL = 'oauth2_provider.AccessToken'
OAUTH2_PROVIDER_APPLICATION_MODEL = 'oauth2_provider.Application'
OAUTH2_PROVIDER_REFRESH_TOKEN_MODEL = 'oauth2_provider.RefreshToken'

OAUTH2_PROVIDER = {
    ...
    # enable the custom scopes backends
    "SCOPES_BACKEND_CLASS": "mitol.oauth_toolkit_extensions.backends.ApplicationAccessOrSettingsScopes",
}

Usage

After installing this app, a modified Application django-admin interface (/admin/oauth2_provider/application/) is available that allows you to optionally create an ApplicationAccess record. If you create this record, it will limit scope authorization to the scopes specified in that record. Otherwise the allowed scopes will be derived from settings.

Project details


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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file mitol_django_oauth_toolkit_extensions-2025.3.17.tar.gz.

File metadata

File hashes

Hashes for mitol_django_oauth_toolkit_extensions-2025.3.17.tar.gz
Algorithm Hash digest
SHA256 436866115d219c093ab2dd1c86d9f6d2f8903cc2853855245b9546054a76d240
MD5 046c3ad6ac74fe351b8e42855bd6aa97
BLAKE2b-256 37427e12a4abaca97d4dd0b48afb7bc4c276aeb7c947181a14737b1a0bd67d6f

See more details on using hashes here.

File details

Details for the file mitol_django_oauth_toolkit_extensions-2025.3.17-py3-none-any.whl.

File metadata

File hashes

Hashes for mitol_django_oauth_toolkit_extensions-2025.3.17-py3-none-any.whl
Algorithm Hash digest
SHA256 0433695d4c5a51b40cdf08f006ae07665115271bd2f0a21b23c1ded7ab4ccaf6
MD5 8f60d2cd800a2ba76917442e7748eb68
BLAKE2b-256 032448f456300768e2e8354d0b157d273db8dbc22b910fb9c33151c39cc98d36

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page