Carlos
Carlos

Reputation: 129

secured API with a JWT

I am currently learning how JWT is working and I am making an API with. I've made a middleware function so for each call to a secured route, the middleware is called and analyze the accessToken. I pass the token in the header of HTTP request in the field authorization, but here is my question :

please help me I really want to learn how it works...

Upvotes: 1

Views: 89

Answers (1)

Arpan Kc
Arpan Kc

Reputation: 938

It depends on the type of connection you are sending the request using:

  • If the request is sent using an SSL encryption (ie HTTPS), then you probably won't have to worry about anyone looking at the headers, as the strong encryption will not allow anyone else to look at the request except the recipient(server).
  • However, if there is no SSL encryption, then the payload sent to the server is exposed and open for prying eyes and vulnerable to MITM attacks.

Upvotes: 1

Related Questions