Module 07 of 10

Authentication & Security

Lessons

About This Module

Your API is now open for business, which means anyone can call it. Before you let real users in, you need to answer two questions: who is making this request, and what are they allowed to do? Authentication proves identity, authorization decides access, and getting both right is what separates a demo from an application you can trust with real data.

You'll start with the two main ways of keeping a user logged in, sessions and tokens such as JWTs, then look at OAuth 2.0 and OpenID Connect, the standards behind "Sign in with Google". From there you'll cover how to store passwords safely with hashing and salting, and how common attacks like cross-site scripting (XSS) and broken authorization work, so you can defend against them.

With a secure, working backend in place, you'll be ready for the next module, State & Rendering Strategies, where you'll look at how the frontend manages data and decides when and where pages are rendered.

Lessons

4 videos
01

Session vs Token Authentication in 100 Seconds

A quick comparison of the two main ways to keep a user logged in: server-side sessions with cookies, and signed tokens such as JWTs.

02

OAuth 2.0 and OpenID Connect (in Plain English)

A clear walkthrough of how OAuth 2.0 handles delegated access and how OpenID Connect adds login on top, the standards behind "Sign in with Google".

03

Hacker101: Password Storage

Why passwords must never be stored in plain text or with a fast bare hash, and how to use bcrypt or similar slow, salted hashing instead.

04

Hacker101: XSS and Authorization

How cross-site scripting and authorization failures happen, including stored, reflected, and DOM XSS, and how to detect and prevent them.