Closed CodeGuro closed 4 years ago
Also, this seems to be an issue exclusive to form authentication. The basic authenticator (and others) don't seem to hang.
I realized this was the wrong place to post this issue. Closing this issue, re-opening in the appropriate repository at https://github.com/phusion/passenger/issues/2231
I came across this issue when I was playing with phusion for a bit...
Consider the following configuration in apache...
The idea here being, I'm coupling apache-phusion form authentication from some custom script (authenticator.py) for an inline login, so that mod_auth_form handles authentication cookies for login sessions. When someone tries to access a sub-url www.example.com/secure/some_file, mod_auth_form would kick in and insert the 401 document for some other location (/index) served by passenger for an inline-login. The intent being that the authenticator script is run and, if successful, the previous request is forwarded to whatever secure sub location the client originally tried to access earlier.
Logging in with the correct credentials works fine - passenger forwards the request as expected. The issue happens with incorrect credentials. Namely, the POST request never returns and the browser/client just hangs on an eternal loading page (until phusion-passenger or apache is restarted). It's as if passenger connects to the socket but doesn't ever forward it to the WSGI application and instead hangs on to it forever. This behaviour does not happen when the ErrorDocument isn't served by passenger. This makes it quite annoying to work with because it'd mean I'd need to make at least 2 application groups... one served by passenger for general views and one served by plain WSGI for the inline login which serves the ErrorDocument views without going through passenger.
For reference (here are the docs), my authenticator script:
...and the HTML served by the web-application, minimal example: