You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a Django project which serves multiple sites via a virtualhostmiddleware setup (not via Django site framework). This allows us to serve multiple sites from a single Django project instance, using the same settings.py but dynamic urlconf.
In this setup, there is a single auth provider, imagine localhost. Other sites use localhost as auth provider. E.g. myapp1.localhost is an OAuth client for localhost (provider). We are using Django social auth pipeline with custom OAuth backend to setup custom OAuth provider.
Everything works fine (from CLI). However, token POST request calls hangs indefinitely under ASGI mode. After some digging, we were able to confirm this behavior by running under WSGI mode, under which everything works fine.
In gist, here is how the flow looks like:
User visits myapp1.localhost:8000/social/login/custom/
This redirects user to localhost:8000/o/authorize/?......
User successfully logins and accepts OAuth flow on localhost:8000
User is redirected back to myapp1.localhost:8000/social/complete/custom/
This triggers a server side API token request to localhost:8000/o/token/ which unfortunately hangs indefinitely.
Add a middleware which adjust request.urlconf based upon incoming host. For localhost urlconf is similar to that of a provider. For myapp1.localhost urlconf simply offers OAuth login/complete/disconnect URLs (using django python social)
Initiating OAuth flow by visiting myapp1.localhost:8000/social/login/custom/ will result in above error.
Disable ASGI and everything will start to work fine. Let me know if a working project is necessary to debug and reproduce this.
Expected behavior
Behavior for ASGI and WSGI should be same. Currently workflow hangs under ASGI mode.
The text was updated successfully, but these errors were encountered:
Describe the bug
We have a Django project which serves multiple sites via a
virtualhost
middleware
setup (not via Django site framework). This allows us to serve multiple sites from a single Django project instance, using the same settings.py but dynamic urlconf.In this setup, there is a single auth provider, imagine
localhost
. Other sites uselocalhost
as auth provider. E.g.myapp1.localhost
is an OAuth client forlocalhost
(provider). We are using Django social auth pipeline with custom OAuth backend to setup custom OAuth provider.Everything works fine (from CLI). However,
token
POST request calls hangs indefinitely underASGI
mode. After some digging, we were able to confirm this behavior by running underWSGI
mode, under which everything works fine.In gist, here is how the flow looks like:
myapp1.localhost:8000/social/login/custom/
localhost:8000/o/authorize/?......
localhost:8000
myapp1.localhost:8000/social/complete/custom/
localhost:8000/o/token/
which unfortunately hangs indefinitely.Looking at logs, it hangs here:
If we disable ASGI mode, everything works smoothly. Then logs look like:
To Reproduce
To reproduce:
request.urlconf
based upon incoming host. Forlocalhost
urlconf is similar to that of a provider. Formyapp1.localhost
urlconf simply offers OAuth login/complete/disconnect URLs (using django python social)myapp1.localhost:8000/social/login/custom/
will result in above error.Disable ASGI and everything will start to work fine. Let me know if a working project is necessary to debug and reproduce this.
Expected behavior
Behavior for ASGI and WSGI should be same. Currently workflow hangs under ASGI mode.
The text was updated successfully, but these errors were encountered: