MCPcopy
hub / github.com/django/django / aauthenticate

Function aauthenticate

django/contrib/auth/__init__.py:132–150  ·  view source on GitHub ↗

See authenticate().

(request=None, **credentials)

Source from the content-addressed store, hash-verified

130
131@sensitive_variables("credentials")
132async def aauthenticate(request=None, **credentials):
133 """See authenticate()."""
134 for backend, backend_path in _get_compatible_backends(request, **credentials):
135 try:
136 user = await backend.aauthenticate(request, **credentials)
137 except PermissionDenied:
138 # This backend says to stop in our tracks - this user should not be
139 # allowed in at all.
140 break
141 if user is None:
142 continue
143 # Annotate the user object with the path of the backend.
144 user.backend = backend_path
145 return user
146
147 # The credentials supplied are invalid to all backends, fire signal.
148 await user_login_failed.asend(
149 sender=__name__, credentials=_clean_credentials(credentials), request=request
150 )
151
152
153def login(request, user, backend=None):

Calls 4

_get_compatible_backendsFunction · 0.85
_clean_credentialsFunction · 0.85
asendMethod · 0.80
aauthenticateMethod · 0.45