Topic on Project:Support desk

Problem with Account Creation through the API

5
Summary by Nibre93

If you specify the realname parameter with the request (even if you just leave it empty), it starts to work correctly.

Nibre93 (talkcontribs)

I'm trying to use the API to create accounts using the mailpassword setting, so it will just send an Email with a temporary password (as explained here).

For whatever reason it refuses to work for me on MediaWiki version 1.28.1.

If I include password and retype variables, the account gets created just fine (sans the Email), so it's not a problem with authentication or any extra login requirements.

However, if I try at all to use mailpassword, the only response I can ever get is 'FAIL', with a status message of 'You need to provide a valid email address.', no matter how I give the email (or even omitting it).

I'm fairly confident that that this is not a client side error, as I've troubleshot to this point from scratch with two separate methods (using curl through PHP, and using Advanced REST Client). It absolutely is receiving everything that it needs to, but just refuses to take the email like it should, and that's leading me to believe that this could be a bug in MediaWiki itself.

I'm posting this here rather than creating a bug report, in the hope that maybe I'm just overlooking something, or that someone else can verify this is working for them correctly on 1.28.1 (to narrow it down to being something on my end).

Any help is appreciated, thanks.

2002:43F4:3186:1234:B8A3:4DE:ED5E:70E3 (talkcontribs)

My wiki runs 1.28.1 and I can send a password reset email just fine.

Nibre93 (talkcontribs)

Through the API using mailpassword? Because I can use the 'Special:CreateAccount' page to manually create accounts just fine, it's the API side that seems to be broken.

Nibre93 (talkcontribs)

I have verified that it is broken on 1.27.1 too, on an entirely separate, fresh install. After playing with them a bit, I think I've found the problem; the email parameter isn't accepted at all through the API, so even if you successfully create the account (by specifying passwords), the Email still isn't set on the account. Because of this confirmation, I'm going to go ahead and submit a bug report for this.

Nibre93 (talkcontribs)

Turns out, the reason it fails was that it was expecting a realname parameter with it, even though it's allowed to just be empty. It should probably be a little more verbose about that, but at least it's working now.