Relative Content

Tag Archive for phplaravelgojwtauthorization

Separate API’s with the same secret key have incompatible JWT’s

I have 2 different api’s with login endpoints, one using Laravel’s Tymon library and the other one is a custom api I made with golang, both are using the exact same secret key and originally (since I’ve never worked with JWT’s before) I assumed that just having the same secret key would be enough to make them interchangeable (plan is to be able to use the jwt generated by Laravel for example to access the custom api’s protected endpoints with it) however, the jwt’s generated by Laravel always gave me an error with my custom api, keep in mind the headers are the exact same and I went and adjusted the payload for the ones generated by the api so that it’s basically the same as the Laravel one, and yet if I try to use the Laravel ones it still fails, any idea why is this happening?