I am trying to implement JWT based authentication system in one of my project and I have stuck between two option where I need some clarifications. I have come up with two approaches for implementing JWT as follows:
This is a good explanation https://auth0.com/learn/refresh-tokens/
Refresh Tokens are long-lived. This means when a client gets one from a server, this token must be stored securely to keep it from being used by potential attackers, for this reason, it is not safe to store them in the browser. If a Refresh Token is leaked, it may be used to obtain new Access Tokens (and access protected resources) until it is blacklisted. Refresh Tokens must be issued to a single authenticated client to prevent the use of leaked tokens by other parties. Access Tokens must also be kept secret, but due to its shorter life, security considerations are less critical.
Also a sessions may be hijacking or fixation done.
If you using SSL all the headers is encrypted.
So I'll prefer a native JWT mechanism and 'll pay attention to the storage of the auth token on client side.