Page MenuHomePhabricator

See if there is API support for determining if a username is already taken without actually submitting all required account creation fields (i.e. pwd, pwd confirmation, email)
Closed, ResolvedPublic

Description

In order to help users complete the account creation flow efficiently, it would be good to verify if a username is available before the user submits the login form.

If possible, we should verify if a username is available after focus is taken off of the username field in the account creation flow.

The existing creation API can give us "Username already exists" as a result message, but we don't want to necessarily use the creation API as a "check" mechanism - i.e. it may be throttled to so many attempts or something - for example if the user tried 2 usernames and the server blocked them on the third attempt etc.

So for this spike determine if there is API support for checking if a user name exists.

Event Timeline

Mhurd renamed this task from Verify if a username is available after focus is taken off of the username field in the account creation flow to See if there is API support for determining if a username is already taken without actually submitting all required account creation fields (i.e. pwd, pwd confirmation, email).Feb 15 2017, 10:53 PM
Mhurd added a project: Spike.
Mhurd updated the task description. (Show Details)
This comment was removed by Mhurd.

Of course there is.

For a local user, it would be enough to do
https://test.wikipedia.org/w/api.php?action=query&list=users&ususers=Platonides&usprop=

However, CentralAuth makes things slightly more complex, so it would be better to use eg.
https://test.wikipedia.org/w/api.php?action=query&meta=globaluserinfo&guiuser=CMadeo%20(WMF)&guiprop=

NB there are a few corner cases where that won't tell you it's actually not available, such as oversighted usernames or names blocked by TitleBlacklist.

Why yes there is: action=query&list=users&usprop=cancreate&ususers=<username>. Although it does not seem to be working properly right now.