Skip to main content

Add-on to django-lti to support dynamic registration.

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.1.4.tar.gz (6.0 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.1.4-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_lti_authentication-0.1.4.tar.gz
Algorithm Hash digest
SHA256 ff9f91661c0190568d967073412c8de14ed9596b549769eae22eeb15dfefcb97
MD5 3c1c2e4ce64c7ef61c9c7f08a7cea3d0
BLAKE2b-256 bbabce3afa3047dc9aaf364e6ff8ffbc546401da16b3d4587c6693ec26275efd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_lti_authentication-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c68870d8401892359bfb65b1115597aa5920f1b224fc37b48c5262e6ef583263
MD5 ee6e9f227968a86f612f1b487b1f9320
BLAKE2b-256 642c54288aa94242b65aa61b0ece1c3f99579c57d7aceb52464129359aa30e13

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