academic-innovation / django-lti

LTI Advantage support for Django projects.
https://academic-innovation.github.io/django-lti/
MIT License
16 stars 7 forks source link

Add Authentication Backend #8

Open michaelwheeler opened 2 years ago

michaelwheeler commented 2 years ago

It seems like it might be useful to create a Django Authentication Backend to allow apps to authenticate users based on LTILaunch information.

The backend might be something as simple as:

from django.contrib.auth.backends import BaseBackend

class LtiLaunchAuthenticationBackend(BaseBackend):
    def authenticate(self, request, lti_launch=None):
        return lti_launch.user.auth_user