Skip to content

Authentication and authorisation

Who are you, and what may you do? Store passwords so a breach is survivable, pick factors that resist phishing, and check permission on every object.

30 min7 steps

By the end you can
  • Distinguish authentication from authorisation and place each check at the right layer
  • Explain how slow, salted password hashing turns a stolen table into an expensive attack
  • Choose authentication factors by how well they resist phishing and replay
  • Enforce object-level authorisation on every request that names an object
  • Choose between role-based, attribute-based and relationship-based authorisation

Two different questions

AuthN: who is calling? AuthZ: may they do this action on this resource? AuthZ runs on every request.

ClientAPIDELETE /projects/42 + session401 = who are you?403 = known, not allowed
Here the answer is 403: authentication passed.

A signed-in user with a valid session calls DELETE /projects/42 on a project they can view but do not own. What should the API return, and which check failed?

Answer this step to continue.