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.1.5.tar.gz (9.8 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.5-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_lti_authentication-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e5827898d44c8b380f8d5a62074a48ed926708a1eb54fed9a2b2e24e4fdd2bd2
MD5 2b85ba90ebb414c036a9e0a91ce816ef
BLAKE2b-256 378208e0c2758c53123e3b20dc270660150267a5dc1c37656d80338c9ae121c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_lti_authentication-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6cd0ae205f088723c7c7140ab81e266ed3b9c82cde292f2a64434ce203607a69
MD5 2fbdd7fda0fcf3f5534b99fad6119408
BLAKE2b-256 2818f59a2ffd6cb8e54912ea59a66a6c4310995c3da45202cd1ed5f6e68c8ce0

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