I have posted a similar message on the Wikimedia Developer Support, but I still can't get my code running, here is my original post:
"I am writing a code to use the MediaWiki web service API to login to the system. Based on the online API documentation, I used “action=query” to get a login token and “action=clientlogin” to post the login request, but I got “Invalid CSRF token” error. I am not sure what I missed, is there a clientlogin sample code, either html or php or any format?"
My code is JavaScript running in the browser, let me know if anyone wants to take a look of my testing code.
Regards,
Ren