Learn Go · Extras

Authentication from Scratch

How login works on most websites, built step by step with only net/http: hashing passwords with bcrypt, session cookies and CSRF tokens.

A 11 min video of its own · 9 steps · no exercises, just build along

This part is in the full course

The first 4 parts of Learn Go are free. The rest, and the extras, come with the full course.

Create an account

What's in it

  • What we're building
  • Registering a user
  • Hashing passwords
  • Logging in
  • Session tokens and cookies
  • CSRF tokens
  • Authorizing requests
  • Logging out
  • Trying it out