Генерируемые AccessTokens заменены на UUID значения

This commit is contained in:
ErickSkrauch
2016-06-18 16:38:15 +03:00
parent 7ea7c5245f
commit eb1a3703cf
3 changed files with 27 additions and 5 deletions

View File

@ -0,0 +1,17 @@
<?php
namespace common\components\oauth\Util\KeyAlgorithm;
use League\OAuth2\Server\Util\KeyAlgorithm\DefaultAlgorithm;
use League\OAuth2\Server\Util\KeyAlgorithm\KeyAlgorithmInterface;
use Ramsey\Uuid\Uuid;
class UuidAlgorithm extends DefaultAlgorithm implements KeyAlgorithmInterface {
/**
* @inheritdoc
*/
public function generate($len = 40) : string {
return Uuid::uuid5(Uuid::NAMESPACE_DNS, parent::generate($len))->toString();
}
}