﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35303	Add async implementations to contrib.auth backends	Jon Janzen	Jon Janzen	"In previous tickets (TODO) we've added an async interface to contrib.auth and then added async implementations to relevant dependencies in other parts of Django.

The time has come to tie all that work together and provide context-switch-free async implementations of auth backends (to the extent possible within the current limitations of async django, namely that async ORM backends do not exist in main yet)

More reading here: https://forum.djangoproject.com/t/asyncifying-django-contrib-auth-and-signals-and-maybe-sessions/18770

Quoting from myself in that doc:

  Once the prereqs are done ([see tickets above]), we could asyncify the internals of the auth app. This would allow for async-compatible backends and then take advantage of them to make the internals of the auth app fully async (if called from an async API entrypoint, like the alogin function that would be implemented in [above initial ticket]).

  Note that I said async-COMPATIBLE. I envision that subclasses of auth.backends.BaseBackend would have several new functions added to support async-mode while still supporting sync-mode in the same classes. Default implementations of async-mode would be added automatically via sync_to_async, and implementers are free to choose to add async support or leave the default, slightly inefficient implementation in place.

You can see a prototype of the implementation on my fork: https://github.com/bigfootjon/django/compare/main...bigfootjon:django:async-contrib-auth"	New feature	closed	contrib.auth	5.0	Normal	fixed	async auth	Carlton Gibson	Ready for checkin	1	0	0	0	0	0
