📌  相关文章
📜  目标 [Lcobucci\JWT\Parser] 在构建 [Laravel\Passport\Http\Controllers\AccessTokenController] 时不可实例化. - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:57.940000             🧑  作者: Mango

代码示例1
use Lcobucci\JWT\Encoding\JoseEncoder;
use Lcobucci\JWT\Token\Parser;
.
.
...
public function GetTokenId(Request $request)
{
  // Get the Access_Token from the request
  $Token = $request->bearerToken();
  // Parse the Access_Token to get the claims from them the jti(Json Token Id)
  $TokenId = (new Parser(new JoseEncoder()))->parse($token)->claims()
   ->all()['jti'];
  return $tokenId;
}