From 40625dbef9ab8677d13310e941bc2932b7485514 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Sat, 2 Dec 2017 22:07:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BF=D1=80=D0=B0=D0=B7=D0=B4=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20aud=20=D0=B8=20iss=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D0=B5=D0=B9=20=D0=B4=D0=BB=D1=8F=20JWT=20?= =?UTF-8?q?=D1=82=D0=BE=D0=BA=D0=B5=D0=BD=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/components/User/Component.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/api/components/User/Component.php b/api/components/User/Component.php index a75c7e8..4049771 100644 --- a/api/components/User/Component.php +++ b/api/components/User/Component.php @@ -131,14 +131,10 @@ class Component extends YiiUserComponent { public function parseToken(string $jwtString): Token { $token = &self::$parsedTokensCache[$jwtString]; if ($token === null) { - $hostInfo = Yii::$app->request->hostInfo; - $jwt = new Jwt(); $notVerifiedToken = $jwt->deserialize($jwtString); $context = new VerificationContext(EncryptionFactory::create($this->getAlgorithm())); - $context->setAudience($hostInfo); - $context->setIssuer($hostInfo); $context->setSubject(self::JWT_SUBJECT_PREFIX); $jwt->verify($notVerifiedToken, $context); @@ -227,12 +223,9 @@ class Component extends YiiUserComponent { */ protected function getClaims(Account $account): array { $currentTime = new DateTime(); - $hostInfo = Yii::$app->request->hostIHttpExceptionnfo; return [ new ScopesClaim([R::ACCOUNTS_WEB_USER]), - new Claim\Audience($hostInfo), - new Claim\Issuer($hostInfo), new Claim\IssuedAt($currentTime), new Claim\Expiration($currentTime->add(new DateInterval($this->expirationTimeout))), new Claim\Subject(self::JWT_SUBJECT_PREFIX . $account->id),