Cherry-pick from PR #2435 (Show TOTP Issuer)
This commit is contained in:
@@ -6,6 +6,10 @@ New features:
|
|||||||
* New automated action to close tasks without activity in a specific column
|
* New automated action to close tasks without activity in a specific column
|
||||||
* Added the possibility to hide tasks in dashboard for a specific column
|
* Added the possibility to hide tasks in dashboard for a specific column
|
||||||
|
|
||||||
|
Improvements:
|
||||||
|
|
||||||
|
* Display TOTP issuer for 2FA
|
||||||
|
|
||||||
Version 1.0.31
|
Version 1.0.31
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,8 @@ class TotpAuth extends Base implements PostAuthenticationProviderInterface
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return GoogleAuthenticator::getQrCodeUrl('totp', $label, $this->secret);
|
$options = array('issuer' => TOTP_ISSUER);
|
||||||
|
return GoogleAuthenticator::getQrCodeUrl('totp', $label, $this->secret, null, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -139,6 +140,7 @@ class TotpAuth extends Base implements PostAuthenticationProviderInterface
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return GoogleAuthenticator::getKeyUri('totp', $label, $this->secret);
|
$options = array('issuer' => TOTP_ISSUER);
|
||||||
|
return GoogleAuthenticator::getKeyUri('totp', $label, $this->secret, null, $options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,3 +134,5 @@ defined('HTTP_PROXY_PORT') or define('HTTP_PROXY_PORT', '3128');
|
|||||||
defined('HTTP_PROXY_USERNAME') or define('HTTP_PROXY_USERNAME', '');
|
defined('HTTP_PROXY_USERNAME') or define('HTTP_PROXY_USERNAME', '');
|
||||||
defined('HTTP_PROXY_PASSWORD') or define('HTTP_PROXY_PASSWORD', '');
|
defined('HTTP_PROXY_PASSWORD') or define('HTTP_PROXY_PASSWORD', '');
|
||||||
defined('HTTP_VERIFY_SSL_CERTIFICATE') or define('HTTP_VERIFY_SSL_CERTIFICATE', true);
|
defined('HTTP_VERIFY_SSL_CERTIFICATE') or define('HTTP_VERIFY_SSL_CERTIFICATE', true);
|
||||||
|
|
||||||
|
defined('TOTP_ISSUER') or define('TOTP_ISSUER', 'Kanboard');
|
||||||
|
|||||||
@@ -35,16 +35,17 @@ class TotpAuthTest extends Base
|
|||||||
public function testGetUrl()
|
public function testGetUrl()
|
||||||
{
|
{
|
||||||
$provider = new TotpAuth($this->container);
|
$provider = new TotpAuth($this->container);
|
||||||
|
|
||||||
$this->assertEmpty($provider->getQrCodeUrl('me'));
|
$this->assertEmpty($provider->getQrCodeUrl('me'));
|
||||||
$this->assertEmpty($provider->getKeyUrl('me'));
|
$this->assertEmpty($provider->getKeyUrl('me'));
|
||||||
|
|
||||||
$provider->setSecret('mySecret');
|
$provider->setSecret('mySecret');
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=M|0&chl=otpauth%3A%2F%2Ftotp%2Fme%3Fsecret%3DmySecret',
|
'https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=M|0&chl=otpauth%3A%2F%2Ftotp%2Fme%3Fsecret%3DmySecret%26issuer%3DKanboard',
|
||||||
$provider->getQrCodeUrl('me')
|
$provider->getQrCodeUrl('me')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals('otpauth://totp/me?secret=mySecret', $provider->getKeyUrl('me'));
|
$this->assertEquals('otpauth://totp/me?secret=mySecret&issuer=Kanboard', $provider->getKeyUrl('me'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAuthentication()
|
public function testAuthentication()
|
||||||
|
|||||||
Reference in New Issue
Block a user