Hello,

I've been trying to have my user remotely sign-in through my laravel/react site, but I've been reaching a dead-end.

After reading this post from 2017 : https://laracasts.com/discuss/channels/general-discussion/single-sign-on-mechanism-for-laravel-and-mediawiki?page=0

I've followed the step for method 2 from: https://www.mediawiki.org/wiki/API:Login

I've request a login token with the api with a "GET" call of "/api.php?action=query&format=json&meta=tokens&type=login"

and received for example:

"97b2edb716fa7b13f2955c79e7f8f0205ceda2c6+\\"

Then I "POST" the result with the formData provided: (I am 100% sure those credentials are valid as I can use them to login)

1.
   action:
   clientlogin
2.
   username:
   TestUser
3.
   password: ********
4.
   loginrequests:
5.
   loginmessageformat:
   wikitext
6.
   loginreturnurl:
   http://localhost:3000/
7.
   logintoken:
   f90d08a1b279a521d24a4f629b678bb35ceda63d+\
8.
   format:
   json

The response that I get back is:

{"warnings":{"main":{"*":"Unrecognized parameters: username, password."}},"clientlogin":{"status":"FAIL","message":"The supplied credentials could not be authenticated.","messagecode":"authmanager-authn-no-primary"}}

What am I missing to correctly remote login a user?

Any help would be appreciated.

Daniel


_______________________________________________
Mediawiki-api mailing list
Mediawiki-api@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

Reply via email to