MediaWiki  1.27.2
MediaWiki\Auth\PreAuthenticationProvider Interface Reference

A pre-authentication provider is a check that must pass for authentication to proceed. More...

Inheritance diagram for MediaWiki\Auth\PreAuthenticationProvider:
Collaboration diagram for MediaWiki\Auth\PreAuthenticationProvider:

Public Member Functions

 postAccountCreation ($user, $creator, AuthenticationResponse $response)
 Post-creation callback. More...
 
 postAccountLink ($user, AuthenticationResponse $response)
 Post-link callback. More...
 
 postAuthentication ($user, AuthenticationResponse $response)
 Post-login callback. More...
 
 testForAccountCreation ($user, $creator, array $reqs)
 Determine whether an account creation may begin. More...
 
 testForAccountLink ($user)
 Determine whether an account may linked to another authentication method. More...
 
 testForAuthentication (array $reqs)
 Determine whether an authentication may begin. More...
 
 testUserForCreation ($user, $autocreate)
 Determine whether an account may be created. More...
 
- Public Member Functions inherited from MediaWiki\Auth\AuthenticationProvider
 getAuthenticationRequests ($action, array $options)
 Return the applicable list of AuthenticationRequests. More...
 
 getUniqueId ()
 Return a unique identifier for this instance. More...
 
 setConfig (Config $config)
 Set configuration. More...
 
 setManager (AuthManager $manager)
 Set AuthManager. More...
 

Detailed Description

A pre-authentication provider is a check that must pass for authentication to proceed.

A PreAuthenticationProvider is used to supply arbitrary checks to be performed before the PrimaryAuthenticationProviders are consulted during the login process. Possible uses include checking that a per-IP throttle has not been reached or that a captcha has been solved.

Since
1.27

Definition at line 41 of file PreAuthenticationProvider.php.

Member Function Documentation

MediaWiki\Auth\PreAuthenticationProvider::postAccountCreation (   $user,
  $creator,
AuthenticationResponse  $response 
)

Post-creation callback.

Parameters
User$userUser that was attempted to be created. This may become a "UserValue" in the future, or User may be refactored into such.
User$creatorUser doing the creation. This may become a "UserValue" in the future, or User may be refactored into such.
AuthenticationResponse$responseAuthentication response that will be returned

Implemented in MediaWiki\Auth\AbstractPreAuthenticationProvider.

MediaWiki\Auth\PreAuthenticationProvider::postAccountLink (   $user,
AuthenticationResponse  $response 
)

Post-link callback.

Parameters
User$userUser that was attempted to be linked. This may become a "UserValue" in the future, or User may be refactored into such.
AuthenticationResponse$responseAuthentication response that will be returned

Implemented in MediaWiki\Auth\AbstractPreAuthenticationProvider.

MediaWiki\Auth\PreAuthenticationProvider::postAuthentication (   $user,
AuthenticationResponse  $response 
)

Post-login callback.

Parameters
User | null$userUser that was attempted to be logged in, if known. This may become a "UserValue" in the future, or User may be refactored into such.
AuthenticationResponse$responseAuthentication response that will be returned

Implemented in MediaWiki\Auth\ThrottlePreAuthenticationProvider, and MediaWiki\Auth\AbstractPreAuthenticationProvider.

MediaWiki\Auth\PreAuthenticationProvider::testForAccountCreation (   $user,
  $creator,
array  $reqs 
)

Determine whether an account creation may begin.

Called from AuthManager::beginAccountCreation()

Note
No need to test if the account exists, AuthManager checks that
Parameters
User$userUser being created (not added to the database yet). This may become a "UserValue" in the future, or User may be refactored into such.
User$creatorUser doing the creation. This may become a "UserValue" in the future, or User may be refactored into such.
AuthenticationRequest[]$reqs
Returns
StatusValue

Implemented in MediaWiki\Auth\ThrottlePreAuthenticationProvider, MediaWiki\Auth\LegacyHookPreAuthenticationProvider, and MediaWiki\Auth\AbstractPreAuthenticationProvider.

MediaWiki\Auth\PreAuthenticationProvider::testForAccountLink (   $user)

Determine whether an account may linked to another authentication method.

Parameters
User$userUser being linked. This may become a "UserValue" in the future, or User may be refactored into such.
Returns
StatusValue

Implemented in MediaWiki\Auth\AbstractPreAuthenticationProvider.

MediaWiki\Auth\PreAuthenticationProvider::testForAuthentication ( array  $reqs)

Determine whether an authentication may begin.

Called from AuthManager::beginAuthentication()

Parameters
AuthenticationRequest[]$reqs
Returns
StatusValue

Implemented in MediaWiki\Auth\ThrottlePreAuthenticationProvider, MediaWiki\Auth\AbstractPreAuthenticationProvider, and MediaWiki\Auth\LegacyHookPreAuthenticationProvider.

MediaWiki\Auth\PreAuthenticationProvider::testUserForCreation (   $user,
  $autocreate 
)

Determine whether an account may be created.

Parameters
User$userUser being created (not added to the database yet). This may become a "UserValue" in the future, or User may be refactored into such.
bool | string$autocreateFalse if this is not an auto-creation, or the source of the auto-creation passed to AuthManager::autoCreateUser().
Returns
StatusValue

Implemented in MediaWiki\Auth\LegacyHookPreAuthenticationProvider, and MediaWiki\Auth\AbstractPreAuthenticationProvider.


The documentation for this interface was generated from the following file: