MediaWiki  master
AbstractSecondaryAuthenticationProvider.php
Go to the documentation of this file.
1 <?php
22 namespace MediaWiki\Auth;
23 
33 {
34 
39  public function continueSecondaryAuthentication( $user, array $reqs ) {
40  throw new \BadMethodCallException( __METHOD__ . ' is not implemented.' );
41  }
42 
47  public function postAuthentication( $user, AuthenticationResponse $response ) {
48  }
49 
54  public function providerAllowsPropertyChange( $property ) {
55  return true;
56  }
57 
64  public function providerRevokeAccessForUser( $username ) {
65  $reqs = $this->getAuthenticationRequests(
66  AuthManager::ACTION_REMOVE, [ 'username' => $username ]
67  );
68  foreach ( $reqs as $req ) {
69  $req->username = $username;
70  $this->providerChangeAuthenticationData( $req );
71  }
72  }
73 
79  AuthenticationRequest $req, $checkData = true
80  ) {
81  return \StatusValue::newGood( 'ignored' );
82  }
83 
89  }
90 
95  public function testForAccountCreation( $user, $creator, array $reqs ) {
96  return \StatusValue::newGood();
97  }
98 
103  public function continueSecondaryAccountCreation( $user, $creator, array $reqs ) {
104  throw new \BadMethodCallException( __METHOD__ . ' is not implemented.' );
105  }
106 
111  public function postAccountCreation( $user, $creator, AuthenticationResponse $response ) {
112  }
113 
118  public function testUserForCreation( $user, $autocreate, array $options = [] ) {
119  return \StatusValue::newGood();
120  }
121 
126  public function autoCreatedAccount( $user, $source ) {
127  }
128 }
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider\testUserForCreation
testUserForCreation( $user, $autocreate, array $options=[])
Determine whether an account may be created.User being created (not added to the database yet)....
Definition: AbstractSecondaryAuthenticationProvider.php:118
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider
A base class that implements some of the boilerplate for a SecondaryAuthenticationProvider.
Definition: AbstractSecondaryAuthenticationProvider.php:33
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider\providerAllowsPropertyChange
providerAllowsPropertyChange( $property)
Determine whether a property can change.AuthManager::allowsPropertyChange() bool Stable to override
Definition: AbstractSecondaryAuthenticationProvider.php:54
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider\providerRevokeAccessForUser
providerRevokeAccessForUser( $username)
Revoke the user's credentials.This may cause the user to no longer exist for the provider,...
Definition: AbstractSecondaryAuthenticationProvider.php:64
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider\providerChangeAuthenticationData
providerChangeAuthenticationData(AuthenticationRequest $req)
Change or remove authentication data (e.g.passwords)If $req was returned for AuthManager::ACTION_CHAN...
Definition: AbstractSecondaryAuthenticationProvider.php:88
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider\autoCreatedAccount
autoCreatedAccount( $user, $source)
Post-auto-creation callback.User being created (has been added to the database now)....
Definition: AbstractSecondaryAuthenticationProvider.php:126
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider\postAccountCreation
postAccountCreation( $user, $creator, AuthenticationResponse $response)
Post-creation callback.This will be called at the end of an account creation attempt....
Definition: AbstractSecondaryAuthenticationProvider.php:111
MediaWiki\Auth\AuthenticationResponse
This is a value object to hold authentication response data.
Definition: AuthenticationResponse.php:37
MediaWiki\Auth\SecondaryAuthenticationProvider
A secondary provider mostly acts when the submitted authentication data has already been associated t...
Definition: SecondaryAuthenticationProvider.php:52
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider\testForAccountCreation
testForAccountCreation( $user, $creator, array $reqs)
Determine whether an account creation may begin.Called from AuthManager::beginAccountCreation()No nee...
Definition: AbstractSecondaryAuthenticationProvider.php:95
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider\providerAllowsAuthenticationDataChange
providerAllowsAuthenticationDataChange(AuthenticationRequest $req, $checkData=true)
Validate a change of authentication data (e.g.passwords)Return StatusValue::newGood( 'ignored' ) if y...
Definition: AbstractSecondaryAuthenticationProvider.php:78
MediaWiki\Auth\AuthenticationProvider\getAuthenticationRequests
getAuthenticationRequests( $action, array $options)
Return the applicable list of AuthenticationRequests.
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider\continueSecondaryAccountCreation
continueSecondaryAccountCreation( $user, $creator, array $reqs)
Continue an authentication flow.User being created (has been added to the database)....
Definition: AbstractSecondaryAuthenticationProvider.php:103
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider\continueSecondaryAuthentication
continueSecondaryAuthentication( $user, array $reqs)
Continue an authentication flow.User being authenticated. This may become a "UserValue" in the future...
Definition: AbstractSecondaryAuthenticationProvider.php:39
MediaWiki\Auth\AuthManager\ACTION_REMOVE
const ACTION_REMOVE
Remove a user's credentials.
Definition: AuthManager.php:110
$source
$source
Definition: mwdoc-filter.php:34
MediaWiki\Auth\AbstractAuthenticationProvider
A base class that implements some of the boilerplate for an AuthenticationProvider Stable to extend.
Definition: AbstractAuthenticationProvider.php:35
MediaWiki\Auth
Definition: AbstractAuthenticationProvider.php:22
MediaWiki\Auth\AbstractSecondaryAuthenticationProvider\postAuthentication
postAuthentication( $user, AuthenticationResponse $response)
Post-login callback.This will be called at the end of a login attempt. It will not be called for unfi...
Definition: AbstractSecondaryAuthenticationProvider.php:47
MediaWiki\Auth\AuthenticationRequest
This is a value object for authentication requests.
Definition: AuthenticationRequest.php:38