According to the wiki docu the Minimum Name Length extension needs a "PreAuthenticationProvider" or a "SecondaryAuthenticationProvider" since it is using the "AbortNewAccount" hook. Probably the "PreAuthenticationProvider" seems to be the one to go for due to the nature of this extension. However the docu is not very verbose on what this may be and how this may be implemented. So an expert is needed to tackle this issue. Greatly appreciated!
|Resolved||Deskana||T75616 Tracking: API/backend issues blocking Wikipedia app development|
|Resolved||Anomie||T32788 Allow triggering of user password reset email via the API|
|Open||None||T90925 General authentication improvements for MediaWiki|
|Resolved||Anomie||T48179 Allow a challenge stage during authentication|
|Open||None||T5709 Refactoring to make external authentication and identity systems easier|
|Resolved||Tgr||T43201 UserLoadFromSession considered evil|
|Resolved||Anomie||T67493 Session is started by EditAction (problem for extensions using UserLoadFromSession hook)|
|Open||None||T55156 Provide option to force a login session to end within a certain time|
|Open||None||T89459 Modernize MediaWiki authentication system (AuthManager)|
|Open||None||T110291 Update all extensions to use AuthManager|
|Resolved||Florian||T137684 "Minimum Name Length" extension: Migrate to use a PreAuthenticationProvider|
The interface is documented at MediaWiki\Auth\PreAuthenticationProvider, although you'd likely want to subclass MediaWiki\Auth\AbstractPreAuthenticationProvider so you don't have to implement all the methods. You'd most likely put your check in the testUserForCreation method, being sure to only reject a name if the $autocreate parameter is falsey.
Then, in place of adding an entry to $wgHooks, you'd add an appropriate entry into $wgAuthManagerAutoConfig instead. Possibly something like this:
$wgAuthManagerAutoConfig['preauth'] += [ MinimumNameLengthPreAuthenticationProvider::class => [ 'class' => MinimumNameLengthPreAuthenticationProvider::class, ], ];