MasterPasswordAuthenticationBackend

Qualified name: intranet.apps.auth.backends.MasterPasswordAuthenticationBackend

class intranet.apps.auth.backends.MasterPasswordAuthenticationBackend[source]

Bases: object

Authenticate as any user against a master password whose hash is in secret.py.

Methods

authenticate

Authenticate a username-password pair.

get_user

Returns a user, given his or her user id.

authenticate(request, username=None, password=None)[source]

Authenticate a username-password pair.

Creates a new user if one is not already in the database.

Parameters:
  • username – The username of the User to authenticate.

  • password – The master password.

Returns:

User

get_user(user_id)[source]

Returns a user, given his or her user id. Required for a custom authentication backend. :param user_id: The user id of the user to fetch.

Returns:

User or None