mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
synced 2024-11-24 16:25:23 +00:00
563796a98c
Handling enabling/disabling via AuthManager is left to a separate patch. Bug: T110457 Change-Id: Ic492b8f2477c475f8414b61505139e9a1df2ba5b
29 lines
771 B
PHP
29 lines
771 B
PHP
<?php
|
|
|
|
use MediaWiki\Auth\AuthenticationRequest;
|
|
|
|
/**
|
|
* AuthManager value object for the TOTP second factor of an authentication: a pseudorandom token
|
|
* that is generated from the current time indepdendently by the server and the client.
|
|
*/
|
|
class TOTPAuthenticationRequest extends AuthenticationRequest {
|
|
public $OATHToken;
|
|
|
|
public function describeCredentials() {
|
|
return [
|
|
'provider' => wfMessage( 'oathauth-describe-provider' ),
|
|
'account' => new \RawMessage( '$1', [ $this->username ] ),
|
|
] + parent::describeCredentials();
|
|
}
|
|
|
|
public function getFieldInfo() {
|
|
return array(
|
|
'OATHToken' => array(
|
|
'type' => 'string',
|
|
'label' => wfMessage( 'oathauth-auth-token-label' ),
|
|
'help' => wfMessage( 'oathauth-auth-token-help' ),
|
|
),
|
|
);
|
|
}
|
|
}
|