2016-02-14 20:50:10 +03:00
|
|
|
<?php
|
2019-09-22 00:17:21 +03:00
|
|
|
declare(strict_types=1);
|
2016-02-14 20:50:10 +03:00
|
|
|
|
2024-12-06 01:34:09 +01:00
|
|
|
namespace common\components\OAuth2\Entities;
|
2016-02-14 20:50:10 +03:00
|
|
|
|
2019-09-22 00:17:21 +03:00
|
|
|
use League\OAuth2\Server\CryptKeyInterface;
|
|
|
|
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
|
|
|
|
use League\OAuth2\Server\Entities\Traits\EntityTrait;
|
|
|
|
use League\OAuth2\Server\Entities\Traits\TokenEntityTrait;
|
2019-12-04 21:10:15 +03:00
|
|
|
use Yii;
|
2016-02-14 20:50:10 +03:00
|
|
|
|
2024-12-02 15:10:55 +05:00
|
|
|
final class AccessTokenEntity implements AccessTokenEntityInterface {
|
2019-09-22 00:17:21 +03:00
|
|
|
use EntityTrait;
|
2019-12-09 19:31:54 +03:00
|
|
|
use TokenEntityTrait;
|
2016-02-14 20:50:10 +03:00
|
|
|
|
2024-12-02 15:10:55 +05:00
|
|
|
public function toString(): string {
|
|
|
|
return Yii::$app->tokensFactory->createForOAuthClient($this)->toString();
|
2016-11-30 02:19:14 +03:00
|
|
|
}
|
|
|
|
|
2019-09-22 00:17:21 +03:00
|
|
|
public function setPrivateKey(CryptKeyInterface $privateKey): void {
|
|
|
|
// We use a general-purpose component to build JWT tokens, so there is no need to keep the key
|
2016-02-14 20:50:10 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|