mediawiki-extensions-OATHAuth/auth/TOTPAuthenticationRequest.php
Reedy 9cceee17cc Clean up code style and docblocks
* array() -> []
* spacing fixes
* dirname( __FILE__ ) -> __DIR__
* Add phpcs style checks using latest mediawiki-codesniffer to keep
  things clean.

Co-Authored-By: Bryan Davis <bd808@wikimedia.org>
Change-Id: I95735f928d3e5d6ac9d2a10d92b40ed01cf2737c
2016-09-30 14:40:06 -06:00

28 lines
758 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 independently
* 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 [
'OATHToken' => [
'type' => 'string',
'label' => wfMessage( 'oathauth-auth-token-label' ),
'help' => wfMessage( 'oathauth-auth-token-help' ), ], ];
}
}