LARAVEL - PASSPORT - 在令牌验证中未验证Expires_at列

时间:2017-08-29 20:44:50

标签: laravel oauth-2.0 laravel-5.4 laravel-passport

我注意到在令牌验证期间未检查“oauth_access_tokens”表中的expires_at列,该列授予对具有过期令牌的用户的访问权。

为了进行测试,我在下面的存储库中使用了示例应用程序:

https://github.com/neoighodaro/laravel-passport-demo

运行“php artisan passport:install”命令后,我手动将“expires_at”列更新为过去的日期。

但是,即使令牌已过期,消费者服务仍然可以检索结果。

我使用以下方法检查了MYSQL日志:

SET GLOBAL general_log = 'ON';

执行的查询是:

select * from `oauth_access_tokens` where `oauth_access_tokens`.`id` = '3e19b972734fcfdf7951de363fc5e9aeab9ea962cf0de7d686a6d2805879d1c4cfa624973eec6ebf' limit 1

不应该是:

select * from `oauth_access_tokens` where `oauth_access_tokens`.`id` = '3e19b972734fcfdf7951de363fc5e9aeab9ea962cf0de7d686a6d2805879d1c4cfa624973eec6ebf' and revoked = 0 and expires_at >= <Carbon::now()> limit 1

0 个答案:

没有答案
相关问题