MediaWiki  1.27.2
MediaWiki\Auth\AbstractPreAuthenticationProvider Class Reference

A base class that implements some of the boilerplate for a PreAuthenticationProvider. More...

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

Public Member Functions

 getAuthenticationRequests ($action, array $options)
 Return the applicable list of AuthenticationRequests. More...
 
 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\AbstractAuthenticationProvider
 getUniqueId ()
 Return a unique identifier for this instance.This must be the same across requests. If multiple instances return the same ID, exceptions will be thrown from AuthManager.
Returns
string
More...
 
 setConfig (Config $config)
 Set configuration. More...
 
 setLogger (LoggerInterface $logger)
 
 setManager (AuthManager $manager)
 Set AuthManager. More...
 

Additional Inherited Members

- Protected Attributes inherited from MediaWiki\Auth\AbstractAuthenticationProvider
Config $config
 
LoggerInterface $logger
 
AuthManager $manager
 

Detailed Description

A base class that implements some of the boilerplate for a PreAuthenticationProvider.

Since
1.27

Definition at line 29 of file AbstractPreAuthenticationProvider.php.

Member Function Documentation

MediaWiki\Auth\AbstractPreAuthenticationProvider::getAuthenticationRequests (   $action,
array  $options 
)

Return the applicable list of AuthenticationRequests.

Possible values for $action depend on whether the implementing class is also a PreAuthenticationProvider, PrimaryAuthenticationProvider, or SecondaryAuthenticationProvider.

  • ACTION_LOGIN: Valid for passing to beginAuthentication. Called on all providers.
  • ACTION_CREATE: Valid for passing to beginAccountCreation. Called on all providers.
  • ACTION_LINK: Valid for passing to beginAccountLink. Called on linking primary providers only.
  • ACTION_CHANGE: Valid for passing to AuthManager::changeAuthenticationData to change credentials. Called on primary and secondary providers.
  • ACTION_REMOVE: Valid for passing to AuthManager::changeAuthenticationData to remove credentials. Must work without additional user input (i.e. without calling loadFromSubmission). Called on primary and secondary providers.
See also
AuthManager::getAuthenticationRequests()
Parameters
string$action
array$optionsOptions are:
  • username: User name related to the action, or null/unset if anon.
    • ACTION_LOGIN: The currently logged-in user, if any.
    • ACTION_CREATE: The account creator, if non-anonymous.
    • ACTION_LINK: The local user being linked to.
    • ACTION_CHANGE: The user having data changed.
    • ACTION_REMOVE: The user having data removed. This does not need to be copied into the returned requests, you only need to pay attention to it if the set of requests differs based on the user.
Returns
AuthenticationRequest[]

Implements MediaWiki\Auth\AuthenticationProvider.

Definition at line 33 of file AbstractPreAuthenticationProvider.php.

MediaWiki\Auth\AbstractPreAuthenticationProvider::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

Implements MediaWiki\Auth\PreAuthenticationProvider.

Definition at line 52 of file AbstractPreAuthenticationProvider.php.

MediaWiki\Auth\AbstractPreAuthenticationProvider::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

Implements MediaWiki\Auth\PreAuthenticationProvider.

Definition at line 59 of file AbstractPreAuthenticationProvider.php.

MediaWiki\Auth\AbstractPreAuthenticationProvider::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

Implements MediaWiki\Auth\PreAuthenticationProvider.

Definition at line 41 of file AbstractPreAuthenticationProvider.php.

MediaWiki\Auth\AbstractPreAuthenticationProvider::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

Implements MediaWiki\Auth\PreAuthenticationProvider.

Definition at line 44 of file AbstractPreAuthenticationProvider.php.

MediaWiki\Auth\AbstractPreAuthenticationProvider::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

Implements MediaWiki\Auth\PreAuthenticationProvider.

Definition at line 55 of file AbstractPreAuthenticationProvider.php.

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

Determine whether an authentication may begin.

Called from AuthManager::beginAuthentication()

Parameters
AuthenticationRequest[]$reqs
Returns
StatusValue

Implements MediaWiki\Auth\PreAuthenticationProvider.

Definition at line 37 of file AbstractPreAuthenticationProvider.php.

MediaWiki\Auth\AbstractPreAuthenticationProvider::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

Implements MediaWiki\Auth\PreAuthenticationProvider.

Definition at line 48 of file AbstractPreAuthenticationProvider.php.


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