MediaWiki master
AbstractSecondaryAuthenticationProvider.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\Auth;
8
18{
19
24 public function continueSecondaryAuthentication( $user, array $reqs ) {
25 throw new \BadMethodCallException( __METHOD__ . ' is not implemented.' );
26 }
27
32 public function postAuthentication( $user, AuthenticationResponse $response ) {
33 }
34
39 public function providerAllowsPropertyChange( $property ) {
40 return true;
41 }
42
49 public function providerRevokeAccessForUser( $username ) {
50 $reqs = $this->getAuthenticationRequests(
51 AuthManager::ACTION_REMOVE, [ 'username' => $username ]
52 );
53 foreach ( $reqs as $req ) {
54 $req->username = $username;
56 }
57 }
58
64 AuthenticationRequest $req, $checkData = true
65 ) {
66 return \StatusValue::newGood( 'ignored' );
67 }
68
75
80 public function testForAccountCreation( $user, $creator, array $reqs ) {
81 return \StatusValue::newGood();
82 }
83
88 public function continueSecondaryAccountCreation( $user, $creator, array $reqs ) {
89 throw new \BadMethodCallException( __METHOD__ . ' is not implemented.' );
90 }
91
96 public function postAccountCreation( $user, $creator, AuthenticationResponse $response ) {
97 }
98
103 public function testUserForCreation( $user, $autocreate, array $options = [] ) {
104 return \StatusValue::newGood();
105 }
106
111 public function autoCreatedAccount( $user, $source ) {
112 }
113}
A base class that implements some of the boilerplate for an AuthenticationProvider.
A base class that implements some of the boilerplate for a SecondaryAuthenticationProvider.
providerAllowsPropertyChange( $property)
Determine whether a property can change.AuthManager::allowsPropertyChange() bool
testUserForCreation( $user, $autocreate, array $options=[])
Determine whether an account may be created.StatusValue
postAccountCreation( $user, $creator, AuthenticationResponse $response)
Post-creation callback.This will be called at the end of an account creation attempt....
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...
continueSecondaryAuthentication( $user, array $reqs)
Continue an authentication flow.AuthenticationResponse Expected responses:PASS: The user is authentic...
continueSecondaryAccountCreation( $user, $creator, array $reqs)
Continue an authentication flow.AuthenticationResponse Expected responses:PASS: The user creation is ...
testForAccountCreation( $user, $creator, array $reqs)
Determine whether an account creation may begin.Called from AuthManager::beginAccountCreation()No nee...
providerRevokeAccessForUser( $username)
Revoke the user's credentials.This may cause the user to no longer exist for the provider,...
providerAllowsAuthenticationDataChange(AuthenticationRequest $req, $checkData=true)
Validate a change of authentication data (e.g.passwords)Return StatusValue::newGood( 'ignored' ) if y...
providerChangeAuthenticationData(AuthenticationRequest $req)
Change or remove authentication data (e.g.passwords)If $req was returned for AuthManager::ACTION_CHAN...
const ACTION_REMOVE
Remove a user's credentials.
This is a value object for authentication requests.
This is a value object to hold authentication response data.
getAuthenticationRequests( $action, array $options)
Return the applicable list of AuthenticationRequests.
Secondary providers act after input data is already associated with a MediaWiki account.
$source