MediaWiki
1.33.0
|
A base class that implements some of the boilerplate for a SecondaryAuthenticationProvider. More...
Public Member Functions | |
autoCreatedAccount ( $user, $source) | |
Post-auto-creation callback. More... | |
continueSecondaryAccountCreation ( $user, $creator, array $reqs) | |
Continue an authentication flow. More... | |
continueSecondaryAuthentication ( $user, array $reqs) | |
Continue an authentication flow. More... | |
postAccountCreation ( $user, $creator, AuthenticationResponse $response) | |
Post-creation callback. More... | |
postAuthentication ( $user, AuthenticationResponse $response) | |
Post-login callback. More... | |
providerAllowsAuthenticationDataChange (AuthenticationRequest $req, $checkData=true) | |
Validate a change of authentication data (e.g. More... | |
providerAllowsPropertyChange ( $property) | |
Determine whether a property can change. More... | |
providerChangeAuthenticationData (AuthenticationRequest $req) | |
Change or remove authentication data (e.g. More... | |
providerRevokeAccessForUser ( $username) | |
@inheritDoc More... | |
testForAccountCreation ( $user, $creator, array $reqs) | |
Determine whether an account creation may begin. More... | |
testUserForCreation ( $user, $autocreate, array $options=[]) | |
Determine whether an account may be created. More... | |
Public Member Functions inherited from MediaWiki\Auth\AbstractAuthenticationProvider | |
getUniqueId () | |
@inheritDoc More... | |
setConfig (Config $config) | |
Set configuration. More... | |
setLogger (LoggerInterface $logger) | |
setManager (AuthManager $manager) | |
Set AuthManager. More... | |
Public Member Functions inherited from MediaWiki\Auth\AuthenticationProvider | |
getAuthenticationRequests ( $action, array $options) | |
Return the applicable list of AuthenticationRequests. More... | |
Public Member Functions inherited from MediaWiki\Auth\SecondaryAuthenticationProvider | |
beginSecondaryAccountCreation ( $user, $creator, array $reqs) | |
Start an account creation flow. More... | |
beginSecondaryAuthentication ( $user, array $reqs) | |
Start an authentication flow. More... | |
Additional Inherited Members | |
Protected Attributes inherited from MediaWiki\Auth\AbstractAuthenticationProvider | |
Config | $config |
LoggerInterface | $logger |
AuthManager | $manager |
A base class that implements some of the boilerplate for a SecondaryAuthenticationProvider.
Definition at line 30 of file AbstractSecondaryAuthenticationProvider.php.
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider::autoCreatedAccount | ( | $user, | |
$source | |||
) |
Post-auto-creation callback.
User | $user | User being created (has been added to the database now). This may become a "UserValue" in the future, or User may be refactored into such. |
string | $source | The source of the auto-creation passed to AuthManager::autoCreateUser(). |
Implements MediaWiki\Auth\SecondaryAuthenticationProvider.
Definition at line 84 of file AbstractSecondaryAuthenticationProvider.php.
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider::continueSecondaryAccountCreation | ( | $user, | |
$creator, | |||
array | $reqs | ||
) |
Continue an authentication flow.
User | $user | User being created (has been added to the database). This may become a "UserValue" in the future, or User may be refactored into such. |
User | $creator | User doing the creation. This may become a "UserValue" in the future, or User may be refactored into such. |
AuthenticationRequest[] | $reqs |
Implements MediaWiki\Auth\SecondaryAuthenticationProvider.
Reimplemented in MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider, and MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider.
Definition at line 73 of file AbstractSecondaryAuthenticationProvider.php.
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider::continueSecondaryAuthentication | ( | $user, | |
array | $reqs | ||
) |
Continue an authentication flow.
User | $user | User being authenticated. This may become a "UserValue" in the future, or User may be refactored into such. |
AuthenticationRequest[] | $reqs |
Implements MediaWiki\Auth\SecondaryAuthenticationProvider.
Reimplemented in TOTPSecondaryAuthenticationProvider, MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider, and MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider.
Definition at line 34 of file AbstractSecondaryAuthenticationProvider.php.
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider::postAccountCreation | ( | $user, | |
$creator, | |||
AuthenticationResponse | $response | ||
) |
Post-creation callback.
This will be called at the end of an account creation attempt. It will not be called if the account creation process results in a session timeout (possibly after a successful user creation, while a secondary provider is waiting for a response).
User | $user | User that was attempted to be created. This may become a "UserValue" in the future, or User may be refactored into such. |
User | $creator | User doing the creation. This may become a "UserValue" in the future, or User may be refactored into such. |
AuthenticationResponse | $response | Authentication response that will be returned (PASS or FAIL) |
Implements MediaWiki\Auth\SecondaryAuthenticationProvider.
Definition at line 77 of file AbstractSecondaryAuthenticationProvider.php.
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider::postAuthentication | ( | $user, | |
AuthenticationResponse | $response | ||
) |
Post-login callback.
This will be called at the end of a login attempt. It will not be called for unfinished login attempts that fail by the session timing out.
User | null | $user | User 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 | $response | Authentication response that will be returned (PASS or FAIL) |
Implements MediaWiki\Auth\SecondaryAuthenticationProvider.
Definition at line 38 of file AbstractSecondaryAuthenticationProvider.php.
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider::providerAllowsAuthenticationDataChange | ( | AuthenticationRequest | $req, |
$checkData = true |
|||
) |
Validate a change of authentication data (e.g.
passwords)
Return StatusValue::newGood( 'ignored' ) if you don't support this AuthenticationRequest type.
AuthenticationRequest | $req | |
bool | $checkData | If false, $req hasn't been loaded from the submission so checks on user-submitted fields should be skipped. $req->username is considered user-submitted for this purpose, even if it cannot be changed via $req->loadFromSubmission. |
Implements MediaWiki\Auth\SecondaryAuthenticationProvider.
Definition at line 60 of file AbstractSecondaryAuthenticationProvider.php.
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider::providerAllowsPropertyChange | ( | $property | ) |
Determine whether a property can change.
string | $property |
Implements MediaWiki\Auth\SecondaryAuthenticationProvider.
Definition at line 41 of file AbstractSecondaryAuthenticationProvider.php.
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider::providerChangeAuthenticationData | ( | AuthenticationRequest | $req | ) |
Change or remove authentication data (e.g.
passwords)
If $req was returned for AuthManager::ACTION_CHANGE, the corresponding credentials should result in a successful login in the future.
If $req was returned for AuthManager::ACTION_REMOVE, the corresponding credentials should no longer result in a successful login.
It can be assumed that providerAllowsAuthenticationDataChange with $checkData === true was called before this, and passed. This method should never fail (other than throwing an exception).
AuthenticationRequest | $req |
Implements MediaWiki\Auth\SecondaryAuthenticationProvider.
Definition at line 66 of file AbstractSecondaryAuthenticationProvider.php.
Referenced by MediaWiki\Auth\AbstractSecondaryAuthenticationProvider\providerRevokeAccessForUser().
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider::providerRevokeAccessForUser | ( | $username | ) |
@inheritDoc
Implements MediaWiki\Auth\SecondaryAuthenticationProvider.
Definition at line 50 of file AbstractSecondaryAuthenticationProvider.php.
References $req, $username, MediaWiki\Auth\AuthManager\ACTION_REMOVE, as, MediaWiki\Auth\AuthenticationProvider\getAuthenticationRequests(), and MediaWiki\Auth\AbstractSecondaryAuthenticationProvider\providerChangeAuthenticationData().
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider::testForAccountCreation | ( | $user, | |
$creator, | |||
array | $reqs | ||
) |
Determine whether an account creation may begin.
Called from AuthManager::beginAccountCreation()
User | $user | User being created (not added to the database yet). This may become a "UserValue" in the future, or User may be refactored into such. |
User | $creator | User doing the creation. This may become a "UserValue" in the future, or User may be refactored into such. |
AuthenticationRequest[] | $reqs |
Implements MediaWiki\Auth\SecondaryAuthenticationProvider.
Definition at line 69 of file AbstractSecondaryAuthenticationProvider.php.
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider::testUserForCreation | ( | $user, | |
$autocreate, | |||
array | $options = [] |
||
) |
Determine whether an account may be created.
User | $user | User 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 | $autocreate | False if this is not an auto-creation, or the source of the auto-creation passed to AuthManager::autoCreateUser(). |
array | $options |
|
Implements MediaWiki\Auth\SecondaryAuthenticationProvider.
Reimplemented in MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider.
Definition at line 80 of file AbstractSecondaryAuthenticationProvider.php.