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

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

◆ postAccountCreation()

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.

◆ postAccountLink()

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.

◆ postAuthentication()

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\AbstractPreAuthenticationProvider, and MediaWiki\Auth\ThrottlePreAuthenticationProvider.

◆ testForAccountCreation()

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\AbstractPreAuthenticationProvider, MediaWiki\Auth\LegacyHookPreAuthenticationProvider, and MediaWiki\Auth\ThrottlePreAuthenticationProvider.

◆ testForAccountLink()

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.

◆ testForAuthentication()

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\AbstractPreAuthenticationProvider, MediaWiki\Auth\LegacyHookPreAuthenticationProvider, and MediaWiki\Auth\ThrottlePreAuthenticationProvider.

◆ testUserForCreation()

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\AbstractPreAuthenticationProvider, and MediaWiki\Auth\LegacyHookPreAuthenticationProvider.


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