首页 > 解决方案 > 使用 laravel/passport 时密文太短

问题描述

任何人都可以帮助解决我在设置 laravel/passport 时遇到的问题吗?

我目前已经让授予客户访问用户数据的权限进行了排序,并将 auth_codes 存储在数据库中。

但是,当去 POST http://my-app.test/oauth/token检索访问令牌时,我得到以下响应。

{
    "error": "invalid_request",
    "error_description": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.",
    "hint": "Cannot decrypt the authorization code",
    "message": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed."
}

我通过以下参数发送

grant_type:authorization_code
client_id:3
client_secret:TYSRJyZAGeSAnzFYyYKAp5F15C4EJiea4V5oamm2
redirect_ui:http://my-app.test/callback
code:5f2d0685414689cc322d10e5ada221e020d00036b1f9fe4154e5578511ed2a51373aa187142a96f2

稍微挖掘一下护照,我发现 defuse/php-encryption 包抛出以下错误:

密文太短

这可能是相关的吗?如果是,我应该怎么做才能解决这个问题?我尝试过使用钠/mcrypt php 扩展。

标签: phplaravel-5laravel-passportmcryptlibsodium

解决方案


推荐阅读