Closed gbenson closed 2 days ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.17%. Comparing base (
98e2423
) to head (f8ebd63
). Report is 1 commits behind head on master.
With this PR, could or should the username and password options be removed? Also, are there open sites with examples of using this form of authentication?
With this PR, could or should the username and password options be removed?
No, it's a separate thing. The existing username and password are for your account on that particular wiki, they're checked and enforced by MediaWiki itself. The one I added are for HTTP authentication which is usually checked and enforced by the web server, e.g. with Apache you can do it by adding a .htaccess
file to the MediaWiki directory on the server like this:
AuthType Basic
AuthUserFile /path/to/.htusers
AuthName "private wiki"
Require valid-user
The browser will pop up a box asking for the username and password before even touching any MediaWiki code. (docs: Apache, nginx)
Also, are there open sites with examples of using this form of authentication?
Probably not, it's kind of a "total lockdown" form of site protection. I use it on a site I have for private notes, but I could probably set you something up if you need one for testing. Let me know!
This pull request adds support for HTTP authentication, by adding an
http_auth
argument and property toMediaWiki
. Whatever you pass/set ashttp_auth
gets passed to Requests as anauth
parameter, so you can do any of these:or:
or: