2015-11-16 02:52:23 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use MediaWiki\Auth\AuthenticationRequest;
|
|
|
|
|
|
|
|
/**
|
2016-09-28 22:31:53 +00:00
|
|
|
* AuthManager value object for the TOTP second factor of an authentication:
|
|
|
|
* a pseudorandom token that is generated from the current time independently
|
|
|
|
* by the server and the client.
|
2015-11-16 02:52:23 +00:00
|
|
|
*/
|
|
|
|
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() {
|
2016-09-16 23:18:35 +00:00
|
|
|
return [
|
|
|
|
'OATHToken' => [
|
2015-11-16 02:52:23 +00:00
|
|
|
'type' => 'string',
|
|
|
|
'label' => wfMessage( 'oathauth-auth-token-label' ),
|
2016-09-16 23:18:35 +00:00
|
|
|
'help' => wfMessage( 'oathauth-auth-token-help' ), ], ];
|
2015-11-16 02:52:23 +00:00
|
|
|
}
|
|
|
|
}
|