Search code examples
authenticationsymfonyjwtapi-platform

Why is lexik-jwt bundle returning an empty token with correct credentials?


First of all: I am using apiplatform to create a pwa which can be used as a GUI to request backend api routes with ease which uses symfony and a jwt token bundle called lexik-jwt. So my current state of my backend application is that the auth route is defined inside api-platform and it's accessible without any problem. It also recognizes correct credentials to be entered as it's printing out "Invalid credentials" in case it isn't.

However, when entering the correct exact case sensitive credentials, I get an empty string returned. What I've done to set this up is carefully following the guidelines of these blog entries provided by api-platform: jwt blog entry & user blog entry.

I am asking you gently to help me here because neither AI nor google could help me here with a little bit of research... I was also trying to solve it for like 3 hours and I can't make any progress which is why I ended up here.

Below you'll find some config which most likely relies on lexik-jwt bundle:
services.yaml: https://pastebin.com/mdPkZQqr
routes.yaml: https://pastebin.com/ARYdLHgb
security.yaml: https://pastebin.com/bDyGuf0d
api_platform.yaml: https://pastebin.com/dRhfuHAG


Solution

  • Try to run php bin/console lexik:jwt:generate-keypair --overwrite.