Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Estev's avatar
Level 2

Lumen + Dingo + JWT = Error 401

Hi,

I'm using this package for my project : https://github.com/krisanalfa/lumen-jwt

My project was working perfectly on my local server but not when i make it online.

I can login successfully but after that, each request receive a 401 error.

Failed to authenticate because of bad credentials or an invalid authorization header.

like the token is not right but it is there and it's right. I tried to run a local server on my server and send some curl request locally it is working. But remote curl request doesn;t work.

i'm on this problem since more than 2 days and i couldn't find the issue. All debug i did led me to a server problem but what ?

Any help ?

Thank you.

0 likes
4 replies
Estev's avatar
Level 2

I'm out of solution for this ... I spent weeks on my project and i can't deploy it on my server. It's very frustrating

Robert-Jan's avatar

Does your server accept the Authorization header? Some servers don't allow the use of the header by default.

Estev's avatar
Level 2

i switched to PHP-FPM and it works now

Please or to participate in this conversation.