auth.backends.RemoteUserBackend.configure_user()

RemoteUserBackend.configure_user(user) Configures a newly created user. This method is called immediately after a new user is created, and can be used to perform custom setup actions, such as setting the user’s groups based on attributes in an LDAP directory. Returns the user object.

auth.context_processors.auth()

auth() [source] If this processor is enabled, every RequestContext will contain these variables: user – An auth.User instance representing the currently logged-in user (or an AnonymousUser instance, if the client isn’t logged in). perms – An instance of django.contrib.auth.context_processors.PermWrapper, representing the permissions that the currently logged-in user has.

auth.backends.RemoteUserBackend.authenticate()

RemoteUserBackend.authenticate(remote_user) The username passed as remote_user is considered trusted. This method simply returns the User object with the given username, creating a new User object if create_unknown_user is True. Returns None if create_unknown_user is False and a User object with the given username is not found in the database.

auth.backends.RemoteUserBackend

class RemoteUserBackend Use this backend to take advantage of external-to-Django-handled authentication. It authenticates using usernames passed in request.META['REMOTE_USER']. See the Authenticating against REMOTE_USER documentation. If you need more control, you can create your own authentication backend that inherits from this class and override these attributes or methods:

auth.backends.ModelBackend.has_perm()

has_perm(user_obj, perm, obj=None) Uses get_all_permissions() to check if user_obj has the permission string perm. Returns False if the user is not is_active.

auth.backends.ModelBackend.has_module_perms()

has_module_perms(self, user_obj, app_label) Returns whether the user_obj has any permissions on the app app_label.

auth.backends.ModelBackend.get_user_permissions()

get_user_permissions(user_obj, obj=None) Returns the set of permission strings the user_obj has from their own user permissions. Returns an empty set if is_anonymous or is_active is False.

auth.backends.ModelBackend.user_can_authenticate()

user_can_authenticate() New in Django 1.10. Returns whether the user is allowed to authenticate. To match the behavior of AuthenticationForm which prohibits inactive users from logging in, this method returns False for users with is_active=False. Custom user models that don’t have an is_active field are allowed.

auth.backends.ModelBackend

class ModelBackend This is the default authentication backend used by Django. It authenticates using credentials consisting of a user identifier and password. For Django’s default user model, the user identifier is the username, for custom user models it is the field specified by USERNAME_FIELD (see Customizing Users and authentication). It also handles the default permissions model as defined for User and PermissionsMixin. has_perm(), get_all_permissions(), get_user_permissions(), and get_g

auth.backends.ModelBackend.get_all_permissions()

get_all_permissions(user_obj, obj=None) Returns the set of permission strings the user_obj has, including both user permissions and group permissions. Returns an empty set if is_anonymous or is_active is False.