X.509 authentication backend.
- class X509Backend¶
Authenticate a user from a X.509 client certificate.
The certificate is passed in by the browser. This backend relies on the X509AuthMiddleware to extract a username field from the client certificate.
- backend_id = 'x509'¶
The unique ID for the authentication backend.
- name = 'X.509 Public Key'¶
The display name for the authentication backend.
This will be shown in the list of backends in the administration UI.
- supports_change_password = True¶
Whether this backend supports changing the user’s password.
- authenticate(request, x509_field='', **kwargs)¶
Authenticate the user.
This will extract the username from the provided certificate and return the appropriate User object.
Changed in version 4.0: The
requestargument is now mandatory as the first positional argument, as per requirements in Django.
The authenticated user, or
Noneif the user could not be authenticated for any reason.
- Return type:
Validate the ‘username’ field.
This checks to make sure that the contents of the username field are valid for X509 authentication.
- get_or_create_user(username, request)¶
Get an existing user, or create one if it does not exist.