Q39: How does JWT authentication work in a Node.js REST API?

JSON Web Tokens (JWT) contain encoded JSON claims signed with a secret or key. The server verifies the token sent in the Authorization header (Bearer <token>) on subsequent requests.

Key Takeaways
  • Stateless authentication mechanism for RESTful APIs.
  • Tokens are signed to prevent client-side tampering.
Knowledge Check

Which HTTP header is standard for passing JWT tokens?