Auth101: Web Authentication Tutorials in Node.js
3 posts on auth101series, newest first.
Auth101 is GeekCoding101’s series on how web authentication actually works. It has three hands-on posts covering password authentication, HTTP Basic Auth and JWT, each built in Node.js. Read them in order: each one builds on the idea of “who is making this request?” from the post before.
Start here: reading order
| # | Post | What you’ll learn | Read time |
|---|---|---|---|
| 1 | Password Authentication in Node.js: A Step-by-Step Guide (Jul 23, 2023) | The classic username + password check, and how to build it step by step in Node.js | 7 min |
| 2 | HTTP Basic Authentication Explained (RFC 7617) (Oct 1, 2023) | The Authorization header, Base64-encoded username:password, why it needs HTTPS, and a Node.js + TypeScript middleware example | 7 min |
| 3 | Unlocking Web Security: Master JWT Authentication (Jan 15, 2024) | JWT claims, token structure and signing algorithms, then JWT authentication from scratch in Node.js with complete, runnable example code | 12 min |
Total reading time is about 26 minutes.
How the three methods compare
| Password login | HTTP Basic Auth | JWT | |
|---|---|---|---|
| What the client sends | Username and password, once at login | Base64 username:password in the Authorization header on every request | A signed token, usually in the Authorization: Bearer header |
| Is the secret protected by the format? | No, it relies on HTTPS and on server-side password storage | No. Base64 is encoding, not encryption, so HTTPS is required | The signature stops tampering. The payload is readable unless it is also encrypted |
| Typical use | Login forms for user-facing apps | Simple internal tools, quick API protection | APIs and services that verify requests without a server-side session lookup |
| Covered in | Part 1 | Part 2 | Part 3 |
- 11 min read
JWT Authentication in Node.js From Scratch
How a JWT works (header, claims, signature, HS256 vs RS256), then build JWT access and refresh tokens from scratch in Node.js and TypeScript.
- 7 min read
HTTP Basic Authentication Explained (RFC 7617)
How HTTP Basic Auth works: the Authorization header, Base64 username:password, why it needs HTTPS, plus a Node.js and TypeScript middleware example.
- 10 min read
Node.js Password Authentication with bcrypt and TypeScript
Build register and login routes in Express and TypeScript, hash passwords with bcryptjs, and see what each part of a bcrypt hash ($2a$10$…) means.
FAQ
What is the Auth101 series? It is a set of GeekCoding101 tutorials on web authentication fundamentals. The three posts cover password authentication, HTTP Basic Auth and JWT, each with Node.js code you can follow on your own machine.
In what order should I read the posts? Start with password authentication, then HTTP Basic Auth, then JWT. The list below the table shows newest first. The table above gives the learning order.
Is HTTP Basic Authentication secure?
Only over HTTPS. Basic Auth sends username:password encoded in Base64, and anyone who can see the request can decode it. Part 2 explains why and shows a Node.js middleware example.
What’s the difference between HTTP Basic Auth and JWT? With Basic Auth, the client sends its credentials on every request. With JWT, the client sends a signed token that the server can verify instead. Parts 2 and 3 cover each in detail.
Is it free? Yes. Every post on GeekCoding101 is free to read, with no sign-up.