โ† API Security learning path
API Security ยท Module 2 of 8

Authentication

Prove who is calling.

๐Ÿ“– Key ideas

  1. Authentication answers 'who are you?'; use proven methods such as OAuth 2.0 / OpenID Connect or a trusted identity provider.
  2. Send tokens in the Authorization header over HTTPS, never in the URL, where they end up in logs.
  3. Access tokens should be short-lived; refresh tokens let clients get new ones safely.
  4. Verify every token on the server: signature, expiry, issuer and audience.
  5. Protect login with rate limits, strong password hashing (such as bcrypt or Argon2) and multi-factor options.
๐Ÿ’ก Real-life example: A token is like a cinema ticket with the show time printed: the usher checks it is genuine and for this show before letting you in, and it is useless the next day.
AuthenticationChecking who the caller is
Access tokenShort-lived credential sent with each request
Refresh tokenCredential used to get a new access token
Password hashingStoring passwords as one-way scrambled values