Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature request: MediaWiki API integration #7
Cannot login to wiki via MediaWiki API; as a result automated API-based libraries like pywikibot cannot login.
It's theoretically possible to login via API using the hash, but since the MD5 hash is salted the end user has no way of obtaining their own password.
The CASAuth extension is installed in Free Software Directory (aka the Directory). The Free Software Foundation needs pywikibot to occasionally batch upload tens of thousands files to the Directory to sync the wiki with the data provided by the Debian package repository.
I'm afraid I can provide only limited help since I am not currently developing in MediaWiki and have stopped maintaining this project.
I haven't used pywikibot before, but with MediaWiki 1.27.1 I was able to interact with the MediaWiki API using a bot from a Bash command line script. As of 1.27, logins can be facilitated using the
If it's possible to configure pywikibot to use
I can provide this excerpt from my Bash script in case that's helpful. Note that the original script has only been tested on MediaWiki 1.27.1, and this short excerpt hasn't been tested at all.
Good luck to you!
EDIT: If I recall correctly, my bot account was created while I had temporarily disabled CASAuth, so the password salting performed by CASAuth wasn't an issue for me.
Yes, that was exactly the issue. For a normal user there is no way of knowing the hashed salted 'string' MediaWiki recognizes as the account's main password. Wondering if it is possible that CASAuth integrates with CAS so that 'somehow' the passwords that gets sent to MediaWiki API is verified against CAS, instead of the salted hash.
I want to confirm that your script works (even if this cannot be used to solve our problem):
With my user account created while CASAuth enabled:
With my user account created with CASAuth temporarily disabled: