Skip to content

A simple Django app to enable custom behavior for remote user authentication

License

Notifications You must be signed in to change notification settings

HassanKadhem/django-custom-remote-user

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Remote User

Custom Remote User is a Django app that extends remote user authentication enabling custom common behavior. The app currently offers only a case-insensitive backend CaseInsensitiveRemoteUserBackend.

CaseInsensitiveRemoteUserBackend guarantees that all users created using an external authentication service are created with an all-lower case username. This is important because some external authentication services return a case-sensitive username upon login. This is problematic with Django as the built-in user model is case-sensitive. This means a single remote user may have two different records in that database (e.g. 'Username' is different than 'username').

Quick start

  1. Add "custom_remote_user" to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'custom_remote_user',
    ]
    
  2. Add CaseInsensitiveRemoteUserBackend:

    AUTHENTICATION_BACKENDS = [
        'custom_remote_user.backends.CaseInsensitiveRemoteUserBackend',
    ]
    
  3. Add the required middlewares for remote user authentication:

    MIDDLEWARE = [
        ...
        'django.contrib.auth.middleware.AuthenticationMiddleware',
        'django.contrib.auth.middleware.RemoteUserMiddleware',
        ...
    ]
    

About

A simple Django app to enable custom behavior for remote user authentication

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages