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 a username-password pair.
Returns a user, given his or her user id.
Attempts to authenticate a user against PAM.
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