0

I tried to setup a login authentication using LexikJWTAuthentication, I already generated the necessary keys

enter image description here

Here is how its called

config/packages/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

Here is return when I try to login, I used postman

enter image description here

Here is the var_dump of config in vendor/lexik/jwt-authentication-bundle/DependencyInjection/LexikJWTAuthenticationExtension.php

enter image description here

bundles.php enter image description here

lonestar
  • 377
  • 1
  • 7
  • 16

2 Answers2

1

I got the same error and it was from "lexik_jwt_authentication.yaml" was not in my repo, after adding it, the problem was fixed.

0

I pass the same error when passing a production, and honestly it's a bit silly. Cannot find keys because they are not loaded in configuration, ie dependency "nelmio/cors-bundle" was installed as dev.

By reinstalling it

composer require nelmio/cors-bundle

everything works again.

My apologies for my english

Zlatan Omerović
  • 3,863
  • 4
  • 39
  • 67