symfony - 您必须配置“public_key”或“secret_key”。[Symfony]
问题描述
我尝试使用 LexikJWTAuthentication 设置登录身份验证,我已经生成了必要的密钥
这是它的名称
配置/包/lexik_jwt_authentication.yaml
lexik_jwt_authentication:
secret_key:'%kernel.project_dir%/config/jwt/private.pem' # required for token creation
public_key:'%kernel.project_dir%/config/jwt/public.pem' # required for token verification
pass_phrase:'mafdhklkjkn234kas' # required for token creation, usage of an environment variable is recommended
token_ttl: 3600
这是我尝试登录时的返回,我使用了邮递员
这是 vendor/lexik/jwt-authentication-bundle/DependencyInjection/LexikJWTAuthenticationExtension.php 中配置的 var_dump
解决方案
我得到了同样的错误,它来自“lexik_jwt_authentication.yaml”不在我的仓库中,添加它后,问题得到了解决。
推荐阅读
- android - 我在应用程序级别 build.gradle 文件中有错误
- powershell - 计算日期的可选参数
- facebook - 以编程方式取消发送/删除 Facebook Messenger 消息
- tensorflow - Tensorflow 1.15 之后 - 无需安装 tensorflow-gpu 包
- azure - Azure Blob 存储中的文件 ID [AZURE-BLOB]
- python - 在子进程调用后在 Python 中删除 NamedTemporaryFile
- javascript - 使用 Java 脚本打开/关闭侧导航
- java - 附加模式下的 iText 7 嵌入文件不起作用
- jquery - 比较两个数组并标记更新值的最佳方法是什么?
- git - 如何使用多个文件将非常大的项目上传到 Github