---
title: "Discussion on \"Sample JWT Authentication in Node.js\" | Hashnode"
description: "Discussion on \"Sample JWT Authentication in Node.js\". JWTs are compact, simple and great for data transfer, authentication and authorisation. To get a basic knowledge of JWTs, go read my article here. Today, we would create a simple authentication app. For this sample, we would need a code editor (here,..."
url: "https://hashnode.com/posts/sample-jwt-auth-in-nodejs/61d1d55c0cfc5655c18469eb"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Sample JWT Authentication in Node.js](https://hallixon.hashnode.dev/sample-jwt-auth-in-nodejs?utm_source=hashnode&utm_medium=feed)

JWTs are compact, simple and great for data transfer, authentication and authorisation. To get a basic knowledge of JWTs, go read my article here. Today, we would create a simple authentication app. For this sample, we would need a code editor (here,...

Jan 2, 2022 · 4 min read · hallixon.hashnode.dev  
Read the article

-   [#jwt](https://hashnode.com/tag/jwt)
-   [#authentication](https://hashnode.com/tag/authentication)
-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#expressjs-cilb5apda0066e053g7td7q24](https://hashnode.com/tag/expressjs-cilb5apda0066e053g7td7q24)

## Written by

[Emmanuel Allison](https://hashnode.com/@Hallixon)

@Hallixon

  
[View profile](https://hashnode.com/@Hallixon)

Software Engineer. In love with C#, .NET and Node.js.

I am a Computer Engineering student and Software Engineer who enjoys creating solutions while typing away on the computer 👨🏽‍💻

## Responses 1

Markdown supported · ⌘↵ to post

[Prafful Javare](https://hashnode.com/@profgrammer)

[Jan 2, 2022](https://hashnode.com/posts/sample-jwt-auth-in-nodejs/61d1d55c0cfc5655c18469eb/comment/61d22f7c0413645f5c7be8fe)

Great introduction! However I'd like to point out one thing - the standard practice is to send the JWT in the `Authorization` header as a Bearer token, that is, the value of this header should be `Bearer <jwt_here>`. Then we can modify the `/verify` endpoint to check the Authorization header and extract the token by splitting it by space and getting the second value.

[Emmanuel Allison](https://hashnode.com/@Hallixon)

[Jan 2, 2022](https://hashnode.com/posts/sample-jwt-auth-in-nodejs/61d1d55c0cfc5655c18469eb/comment/61d22f7c0413645f5c7be8fe#reply-61d238d80413645f5c7be9b7)

Hi [Prafful Javare](https://hashnode.com/@profgrammer). I know of that, and I made the sample primarily for anyone to understand how to create and verify a JWT using Node.js. Still, I should probably edit and drop this somewhere in the article. Thanks for pointing this out!
