See authenticate().
(request=None, **credentials)
| 130 | |
| 131 | @sensitive_variables("credentials") |
| 132 | async 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 | |
| 153 | def login(request, user, backend=None): |