django_pam.auth package
- django_pam.auth.tests package
- django_pam.auth.tests.base_test module
- django_pam.auth.tests.test_auth_backends module
TestPAMBackend
TestPAMBackend.setUp()
TestPAMBackend.test_authenticate_fail_invalid()
TestPAMBackend.test_authenticate_pass()
TestPAMBackend.test_authenticate_pass_encoding()
TestPAMBackend.test_authenticate_pass_resetcreds()
TestPAMBackend.test_authenticate_pass_service()
TestPAMBackend.test_get_user_invalid()
TestPAMBackend.test_get_user_valid()
django_pam.auth.backends module
Django PAM backend.
- class django_pam.auth.backends.PAMBackend[source]
Bases:
ModelBackend
An implementation of a PAM backend authentication module.
- authenticate(request, username=None, password=None, **extra_fields)[source]
Authenticate using PAM then get the account if it exists else create a new account.
Note
The keyword arguments ‘service’, ‘encoding’, and ‘resetcreds’ can also be passed and will be pulled off the ‘extra_fields’ kwargs.
- Parameters:
username (str) – The users username. This is a manditory field.
password (str) – The users password. This is a manditory field.
extra_fields (dict) – Additonal keyword options of any editable field in the user model or arguments in the PAM authenticate method.
- Return type:
The Django user object or None if it fails.