Skip to main content

authenticate

If the given credentials are valid, return a User object.

def authenticate(
request: HttpRequest = None,
**credentials: dict
) - > User

If the given credentials are valid, return a User object.

Parameters

NameTypeDescription
requestHttpRequest = NoneThe current HTTP request object, used by backends for metadata or session handling.
**credentialsdictKeyword arguments containing authentication credentials such as username, password, or tokens.

Returns

TypeDescription
UserThe authenticated User object annotated with the backend path, or None if authentication failed for all backends.