reviewboard.accounts.backends.x509¶
X.509 authentication backend.
- class X509Backend[source]¶
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.
- authenticate(request, x509_field='', **kwargs)[source]¶
Authenticate the user.
This will extract the username from the provided certificate and return the appropriate User object.
Changed in version 4.0: The
request
argument is now mandatory as the first positional argument, as per requirements in Django.- Parameters
request (django.http.HttpRequest) – The HTTP request from the caller. This may be
None
.x509_field (unicode, optional) – The value of the field containing the username.
**kwargs (dict, unused) – Additional keyword arguments supplied by the caller.
- Returns
The authenticated user, or
None
if the user could not be authenticated for any reason.- Return type