【问题标题】:LexikJWTBundle does not recognize valid configuration keysLexikJWTBundle 无法识别有效的配置密钥
【发布时间】:2018-06-27 20:59:18
【问题描述】:

我使用 lexikjwtauthenticationBundle 得到以下错误

Unrecognized options "secret_key, public_key" under "lexik_jwt_authentication"

我的配置类似于

lexik_jwt_authentication:
secret_key:       '%jwt_private_key_path%' # required for token creation
public_key:       '%jwt_public_key_path%'  # required for token verification
pass_phrase:      '%jwt_key_pass_phrase%'  # required for token creation
token_ttl:        '%jwt_token_ttl%'

而且parameters.yml有以下参数

jwt_private_key_path: '%kernel.root_dir%/config/jwt/private.pem'
jwt_public_key_path: '%kernel.root_dir%/config/jwt/public.pem'
jwt_key_pass_phrase: '*******'
jwt_token_ttl: 3600

【问题讨论】:

    标签: symfony jwt symfony-3.3 lexikjwtauthbundle


    【解决方案1】:

    我能够找到问题的答案。

    lexik_jwt_authentication:
      secret_key:       '%jwt_private_key_path%' # required for token creation
      public_key:       '%jwt_public_key_path%'  # required for token verification
      pass_phrase:      '%jwt_key_pass_phrase%'  # required for token creation
      token_ttl:        '%jwt_token_ttl%'
    

    正确的配置是:

    lexik_jwt_authentication:
      private_key_path: '%jwt_private_key_path%' # required for token creation
      public_key_path: '%jwt_public_key_path%'  # required for token verification
      pass_phrase: '%jwt_key_pass_phrase%'  # required for token creation
      token_ttl: '%jwt_token_ttl%'
    

    【讨论】:

    猜你喜欢
    • 2020-08-23
    • 2022-01-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-03
    • 1970-01-01
    • 1970-01-01
    • 2018-07-01
    相关资源
    最近更新 更多