Skip to main content

django-lti-authentication

Add-on to django-lti that integrates with Django's user authentication system.

Installation

Install the package using pip:

pip install django-lti-authentication

Setup

Start by adding lti_authentication.backends.LtiLaunchAuthenticationBackend to your project's AUTHENTICATION_BACKENDS.

AUTHENTICATION_BACKENDS = [
    ...
    'lti_authentication.backends.LtiLaunchAuthenticationBackend',
]

Then, add lti_authentication.middleware.LtiLaunchAuthenticationMiddleware to the MIDDLEWARE setting. It's important to list the LtiLaunchAuthenticationMiddleware after LtiLaunchMiddleware and AuthenticationMiddleware.

MIDDLEWARE = [
    'lti_tool.middleware.LtiLaunchMiddleware',
    ...
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'lti_authentication.middleware.LtiLaunchAuthenticationMiddleware',
]

Configuring the Django username

By default, the username is set to the sub value from the LTI launch. You can use the person_sourcedid value from the lis claim instead by adding this to your Django settings:

LTI_AUTHENTICATION = {
    'use_person_sourcedid': True,
}

If you want to use a different field, you can subclass LtiLaunchAuthenticationBackend and override the get_username method.

Metadata

Release files for django-lti-authentication 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-lti-authentication 0.2.0
File Size Uploaded
django_lti_authentication-0.2.0.tar.gz 9.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-lti-authentication 0.2.0
File Interpreter ABI Platform
django_lti_authentication-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.7 kB

Release files / django_lti_authentication-0.2.0.tar.gz

Download URL django_lti_authentication-0.2.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ec4b1a6d9071e5115c11e76a31a89967088800601c0e7d729c7726cdd2701f2a
BLAKE2b-256 checksum
How to use checksums
ad18848ab13860553cd3fc239f37872fc800951decfaad9b594054c1aa28f9e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / django_lti_authentication-0.2.0-py3-none-any.whl

Download URL django_lti_authentication-0.2.0-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
815c115940b3555559759616b570219bc3a7a1ba37efb21b4e24f7cd52617034
BLAKE2b-256 checksum
How to use checksums
919e678c6d45f8b33bcb593dfbbb85fae4c813ecca0d279f2e17b06489485aa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page