Problem
ResourceServerBackend.get_user_info_with_introspection() and related methods are synchronous, but perform blocking HTTP calls (token introspection to the authorization server).
When used from an async context (ASGI servers like uvicorn, or async frameworks like Django Bolt/Starlette), these blocking calls freeze the event loop and degrade throughput/latency.
Current workaround
Wrap calls with asgiref.sync.sync_to_async:
from asgiref.sync import sync_to_async
user_info = await sync_to_async(backend.get_user_info_with_introspection)(access_token)
user = await sync_to_async(backend.get_or_create_user)(access_token, None, user_info)
This works but adds thread pool overhead for every request.
Proposed solution
Add native async variants.
Context
We are considering migrating suitenumerique/find from Django REST Framework to Django Bolt (async-native). The OIDC authentication path would block the event loop on every authenticated request.
Problem
ResourceServerBackend.get_user_info_with_introspection()and related methods are synchronous, but perform blocking HTTP calls (token introspection to the authorization server).When used from an async context (ASGI servers like uvicorn, or async frameworks like Django Bolt/Starlette), these blocking calls freeze the event loop and degrade throughput/latency.
Current workaround
Wrap calls with
asgiref.sync.sync_to_async:This works but adds thread pool overhead for every request.
Proposed solution
Add native async variants.
Context
We are considering migrating suitenumerique/find from Django REST Framework to Django Bolt (async-native). The OIDC authentication path would block the event loop on every authenticated request.