MediaWiki REL1_35
AbstractSecondaryAuthenticationProvider.php
Go to the documentation of this file.
1<?php
22namespace 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;
71 }
72 }
73
79 AuthenticationRequest $req, $checkData = true
80 ) {
81 return \StatusValue::newGood( 'ignored' );
82 }
83
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}
A base class that implements some of the boilerplate for an AuthenticationProvider Stable to extend.
A base class that implements some of the boilerplate for a SecondaryAuthenticationProvider.
providerAllowsPropertyChange( $property)
Determine whether a property can change.AuthManager::allowsPropertyChange() bool Stable to override
testUserForCreation( $user, $autocreate, array $options=[])
Determine whether an account may be created.StatusValue Stable to override
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...
autoCreatedAccount( $user, $source)
Post-auto-creation callback. Stable to override
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.
A secondary provider mostly acts when the submitted authentication data has already been associated t...
$source