-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unwanted browser authentication dialog #4
Comments
After deeper investigation, here is what happens :
The client part of this (= add "x-requested-with: XMLHttpRequest" request header) is easy to implement, but I haven't been able to implement the server part (= remove "WWW-Authenticate" response header).
or with a different syntax, which should be more or less equivalent :
Neither of them works, apparently because mod_auth takes the precedence over mod_headers, and the directive above seems to be not evaluated when mod_auth asks for authentication. In conclusion, I haven't been able to solve this problem with some apache tuning, as it lacks flexibility in it's authentication workflow. |
Have you tried the following rule? <IfModule mod_headers.c>
Header always unset WWW-Authenticate "expr=req('x-requested-with') == 'XMLHttpRequest' && resp('WWW-Authenticate') =~ /^Basic/"
</IfModule> The difference is the keyword |
I did, and it doesn't work. I also tried :
=> header "Toto: test" is appended only after authentication, which confirms that during the authentication negotiation, mod_auth takes over mod_header and "Header" directives are not evaluated. |
Ok, so I agree with you: the only solution is to let kTBS manage its own authorization (authentication could still be managed by Apache, though). This is bumps up the priority of ktbs/ktbs#81 ... :-/ |
- added HTTP requests header "X-Requested-With": "XMLHttpRequest" in order to let server recognize API requests (will be usefull to improve authentication workflow : see #4)
@hsaladin I believe this was since been fixed, right? |
In some cases, trying to access a controlled access resource triggers a native browser's authentication dialog, instead of being handled by the application.
This seems to only occur when the KTBS service hosting that resource has the same origin as the application (might be CORS related ?)
The text was updated successfully, but these errors were encountered: