Skip to main content

Add-on to django-lti to integrate with Django's authentication system.

Project description

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.

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

django_lti_authentication-0.2.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

django_lti_authentication-0.2.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file django_lti_authentication-0.2.0.tar.gz.

File metadata

File hashes

Hashes for django_lti_authentication-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ec4b1a6d9071e5115c11e76a31a89967088800601c0e7d729c7726cdd2701f2a
MD5 7cad0c7b3531e0c6d393964a58c3b259
BLAKE2b-256 ad18848ab13860553cd3fc239f37872fc800951decfaad9b594054c1aa28f9e6

See more details on using hashes here.

File details

Details for the file django_lti_authentication-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_lti_authentication-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 815c115940b3555559759616b570219bc3a7a1ba37efb21b4e24f7cd52617034
MD5 b3a9cae54a34e9b7df841caf97dea04d
BLAKE2b-256 919e678c6d45f8b33bcb593dfbbb85fae4c813ecca0d279f2e17b06489485aa3

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