Jump to content

Topic on API talk:Account creation

Anomie (talkcontribs)

@SSethi (WMF): I adjusted the rewrite slightly to remove confusion over different "methods". There's only one method, it's just that it can play out in different ways depending how much the client assumes about which extensions are installed. On one end the client might assume everything and never use API:Authmanagerinfo (except maybe to get the captcha data), while on the other end the client might assume nothing at all and build its UI based entirely on the data returned by API:Authmanagerinfo.

The one remaining possible issue is the header that says "MediaWiki version: ≥ 1.21", but this page documents how it works after it was completely changed in 1.27. Trying to follow the instructions here on a wiki using 1.21–1.26 will quickly fail. API:Account creation/pre-1.27, which was moved to the bottom under "See also", documents how it worked for those versions; I wonder if that should be linked more prominently somehow.

SSethi (WMF) (talkcontribs)

@Anomie Thanks for making the changes! I've tried to highlight the point you've indicated (recent edit). Also, I wanted to learn if you have a sense of how popular the use of the process documented here: https://www.mediawiki.org/w/index.php?title=API:Account_creation#Example_3:_Account_creation_on_a_wiki_with_a_CAPTCHA,_an_OpenID_extension,_and_a_two-factor_authentication_extension_enabled is? Would be useful to have a sample code that illustrates it just like we have now for a wiki with CAPTCHA enabled in Example 2?

Anomie (talkcontribs)

Thanks.

That specific process doesn't actually exist outside of the example, as far as I know. What might be useful as sample code would be something that implements the "on the other end the client might assume nothing at all and build its UI based entirely on the data returned by API:Authmanagerinfo" bit I mentioned above, although actually doing that might be more work than you want to do right now.

SSethi (WMF) (talkcontribs)

@Anomie In the sample code in Example 2, we've `create_account_with_captcha.py` where in we are fetching captcha fields from API:Authmanagerinfo. Will it be useful to expand that example to build the entire UI from the data provided by the module?

Anomie (talkcontribs)

Yes, that's what would be useful.

I leave it to you to decide whether it'd be useful enough for however much work it turns out to be.

You might look at AuthManagerSpecialPage::getAuthForm() in MediaWiki core for some inspiration. That's the method that turns the set of AuthenticationRequests into an HTMLForm for Special:UserLogin and Special:CreateAccount.

Reply to "Recent rewrite"