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.

Setup

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

AUTHENTICATION_BACKENDS = [
    ...
    'lti_tool.auth.backends.LtiLaunchAuthenticationBackend',
]

Then, add lti_tool.auth.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_tool.auth.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.0.tar.gz (5.7 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.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_lti_authentication-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a2397d9e779937cc4ad2aa246df4a9cd5664088e292537ca6a86b1df14f1dd47
MD5 ee91e09dec0c81f92229845a26929e68
BLAKE2b-256 2ec8e352d63e0e8552538a08f528493cd70fcbe98d9e2cd5f5a23c77b221cc83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_lti_authentication-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92ab04836c22ff665aebc9ab349b393e456a19757214574f493ab7d02e4302f3
MD5 d4bb1bd78258e832402c0fd1138bd169
BLAKE2b-256 916a7194c88ea47374c098795e5f55caa83444adc2aa770b14a404fe982a98ff

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