|
MediaWiki master
|
Authentication request for reauthenticating with elevated security. More...
Inherits MediaWiki\Auth\AuthenticationRequest.

Public Member Functions | ||||
| __sleep () | ||||
| getFieldInfo () | ||||
Fetch input field info.This will be used in the AuthManager APIs and web UIs to define API input parameters / form fields and to process the submitted data.The field info is an associative array mapping field names to info arrays. The info arrays have the following keys:
| ||||
| loadFromSubmission (array $data) | ||||
Initialize form submitted form data.The default behavior is to check for each key of self::getFieldInfo() in the submitted data, and copy the value - after type-appropriate transformations - to $this->$key. Most subclasses won't need to override this; if you do override it, make sure to always return false if self::getFieldInfo() returns an empty array.
| ||||
| validate () | ||||
Validate the submitted data.This is called by AuthManager sometime after request data was loaded with loadFromSubmission(). A fatal status will stop the authentication process and result in a FAIL response. (Non-fatal error statuses are ignored for now.)This is meant for authentication errors the user is unable to fix without restarting the process (such as token expiration) or which indicate tampering with the request. Recoverable errors are better handled by methods with allow the user to redo the request without restarting the process (e.g. the AuthChangeFormFields hook).Note that this check was added in MediaWiki 1.46 so don't use it as a security guarantee if you want to support older versions as well.
| ||||
Public Member Functions inherited from MediaWiki\Auth\AuthenticationRequest | ||||
| describeCredentials () | ||||
| Describe the credentials represented by this request. | ||||
| getMetadata () | ||||
| Returns metadata about this request. | ||||
| getUniqueId () | ||||
| Supply a unique key for deduplication. | ||||
Static Public Member Functions | |
| static | __set_state ( $data) |
| Implementing this mainly for use from the unit tests. | |
| static | create (Session $session, $securityLevel) |
| Create a new elevated-security reauthentication request, and store its data in the current session. | |
Static Public Member Functions inherited from MediaWiki\Auth\AuthenticationRequest | |
| static | getRequestByClass (array $reqs, $class, $allowSubclasses=false) |
| Select a request by class name. | |
| static | getUsernameFromRequests (array $reqs) |
| Get the username from the set of requests. | |
| static | loadRequestsFromSubmission (array $reqs, array $data) |
| Update a set of requests with form submit data, discarding ones that fail. | |
| static | mergeFieldInfo (array $reqs) |
| Merge the output of multiple AuthenticationRequest::getFieldInfo() calls. | |
Public Attributes | |
| string | $securityLevel |
| The security level of the reauthentication process. | |
| int | $userId |
| The user who is being reauthenticated. | |
| const int | MAX_AGE = 300 |
| Max allowed time between getAuthenticationRequests() and beginAuthentication(). | |
Public Attributes inherited from MediaWiki\Auth\AuthenticationRequest | |
| string null | $action = null |
| The AuthManager::ACTION_* constant this request was created to be used for. | |
| int | $required = self::REQUIRED |
| Whether the authentication request is required (for login, continue, and link actions). | |
| string null | $returnToUrl = null |
| Return-to URL, in case of a REDIRECT AuthenticationResponse. | |
| string null | $username = null |
| Username. | |
| const | OPTIONAL = 0 |
| Indicates that the request is not required for authentication to proceed. | |
| const | PRIMARY_REQUIRED = 2 |
| Indicates that the request is required by a primary authentication provider. | |
| const | REQUIRED = 1 |
| Indicates that the request is required for authentication to proceed. | |
Authentication request for reauthenticating with elevated security.
Represents an elevated-security reauthentication process (ie. the user proving their identity before getting access to some security-sensitive functionality such as password change or actions restricted to highly privileged users). This request is managed by AuthManager and can be initiated by the securityLevel option of getAuthenticationRequests().
This request being present in the set of requests passed to an authentication provider means that the user is guaranteed not to change during the authentication process (but the session id might renew), and after a successful authentication the user will pass a check for AuthManager::securitySensitiveOperationStatus() with the given security level.
Definition at line 31 of file ElevatedSecurityAuthenticationRequest.php.
|
static |
Implementing this mainly for use from the unit tests.
| array | $data |
Reimplemented from MediaWiki\Auth\AuthenticationRequest.
Definition at line 128 of file ElevatedSecurityAuthenticationRequest.php.
| MediaWiki\Auth\ElevatedSecurityAuthenticationRequest::__sleep | ( | ) |
Definition at line 78 of file ElevatedSecurityAuthenticationRequest.php.
|
static |
Create a new elevated-security reauthentication request, and store its data in the current session.
| Session | $session | The user session which will be elevated. Will be persisted. |
| string | $securityLevel | The security level of the reauthentication process. |
Definition at line 60 of file ElevatedSecurityAuthenticationRequest.php.
References MediaWiki\Auth\ElevatedSecurityAuthenticationRequest\$securityLevel, MediaWiki\Session\Session\getToken(), MediaWiki\Session\Session\getUser(), and MediaWiki\Session\Session\persist().
| MediaWiki\Auth\ElevatedSecurityAuthenticationRequest::getFieldInfo | ( | ) |
Fetch input field info.This will be used in the AuthManager APIs and web UIs to define API input parameters / form fields and to process the submitted data.The field info is an associative array mapping field names to info arrays. The info arrays have the following keys:
Reimplemented from MediaWiki\Auth\AuthenticationRequest.
Definition at line 87 of file ElevatedSecurityAuthenticationRequest.php.
References wfMessage().
| MediaWiki\Auth\ElevatedSecurityAuthenticationRequest::loadFromSubmission | ( | array | $data | ) |
Initialize form submitted form data.The default behavior is to check for each key of self::getFieldInfo() in the submitted data, and copy the value - after type-appropriate transformations - to $this->$key. Most subclasses won't need to override this; if you do override it, make sure to always return false if self::getFieldInfo() returns an empty array.
| array | $data | Submitted data as an associative array (keys will correspond to getFieldInfo()) |
Reimplemented from MediaWiki\Auth\AuthenticationRequest.
Definition at line 101 of file ElevatedSecurityAuthenticationRequest.php.
| MediaWiki\Auth\ElevatedSecurityAuthenticationRequest::validate | ( | ) |
Validate the submitted data.This is called by AuthManager sometime after request data was loaded with loadFromSubmission(). A fatal status will stop the authentication process and result in a FAIL response. (Non-fatal error statuses are ignored for now.)This is meant for authentication errors the user is unable to fix without restarting the process (such as token expiration) or which indicate tampering with the request. Recoverable errors are better handled by methods with allow the user to redo the request without restarting the process (e.g. the AuthChangeFormFields hook).Note that this check was added in MediaWiki 1.46 so don't use it as a security guarantee if you want to support older versions as well.
Reimplemented from MediaWiki\Auth\AuthenticationRequest.
Definition at line 124 of file ElevatedSecurityAuthenticationRequest.php.
| string MediaWiki\Auth\ElevatedSecurityAuthenticationRequest::$securityLevel |
The security level of the reauthentication process.
Definition at line 40 of file ElevatedSecurityAuthenticationRequest.php.
Referenced by MediaWiki\Auth\ElevatedSecurityAuthenticationRequest\create().
| int MediaWiki\Auth\ElevatedSecurityAuthenticationRequest::$userId |
The user who is being reauthenticated.
Should always be an existing local account.
Definition at line 37 of file ElevatedSecurityAuthenticationRequest.php.
| const int MediaWiki\Auth\ElevatedSecurityAuthenticationRequest::MAX_AGE = 300 |
Max allowed time between getAuthenticationRequests() and beginAuthentication().
Definition at line 34 of file ElevatedSecurityAuthenticationRequest.php.