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

SimonFly's avatar

How to store jwt token from external Java API

Hi, i have external API with jwt authentication. Whta is the best way to login user and store this token?

0 likes
2 replies
kallefrombosnia's avatar

It depends on how you check for JWT tokens on the API level.

You can append it on cookie via request header, or if you use some JS-based framework on the client-side, you can handle local store logic and append the token via custom Bearer header or part of the request endpoint string.

You should explore more, JWT is well known on the internet, you will find your answer hopefully.

1 like

Please or to participate in this conversation.