PamAuthenticationBackend

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

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

Bases: object

Authenticate using PAM.

This is the default authentication backend.

Methods

authenticate

Authenticate a username-password pair.

get_user

Returns a user, given his or her user id.

pam_auth

Attempts to authenticate a user against PAM.

pam_auth_timeout_handle

Check if the user exists before we throw an error.

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 password of the User to authenticate.

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

static pam_auth(username, password)[source]

Attempts to authenticate a user against PAM.

Parameters:
  • username – The username.

  • password – The password.

Returns:

Boolean indicating success or failure of PAM authentication

static pam_auth_timeout_handle(username, realm)[source]

Check if the user exists before we throw an error.