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.1.tar.gz (5.6 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.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_lti_authentication-0.1.1.tar.gz
Algorithm Hash digest
SHA256 641f55e3a8590c9548414a9b12ad585144fccfd44bd5a816ca3800350948e054
MD5 8bdacf660b3e1c113b69fc03ba1fd7f8
BLAKE2b-256 018d0eff7a4ffb89333d5b0f412a6dbe8a90cdb91db12194704adc0536945659

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_lti_authentication-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d39d2a05f83a8322d2564e22dda49859f52a84bf051535d0ff65ea93e956a90
MD5 51bae2faeb29074d26dd5ea3228924ea
BLAKE2b-256 a5bf5ecfd7b555d9c97463fe483d9bc71b4c9f094a9ff53c937ca53b81ae7c8d

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