Authentication vs authorization comes down to two questions: who are you, and what are you allowed to do? Authentication checks the first. Authorisation, as it's spelled in British English, decides the second.
They sound alike and often run in the same request, but mixing them up is behind some of the most common security bugs in web apps.
Authentication: proving who you are
Authentication is the step where a system confirms that you are the person, device or service you claim to be. You make a claim ('I am ana@example.com') and back it up with evidence the system can check.
That evidence usually falls into three kinds, often called factors:
- Something you know: a password, a PIN, the answer to a security question.
- Something you have: a phone that receives a code, a hardware security key, a passkey stored on your device.
- Something you are: a fingerprint or a face scan.
Multi-factor authentication (MFA) asks for two or more different kinds. A stolen password alone is then not enough, because the attacker also needs your phone or your fingerprint.
Authentication happens once, at sign-in, and its result is remembered. After checking your password, the server gives your browser a session cookie or a token. Every later request carries that cookie or token, so the server can recognise you without asking for the password again. When the session expires or you sign out, you are a stranger again.
Authorisation: what you are allowed to do
Authorisation starts where authentication ends. The system now knows who you are, and it has to decide whether this particular action is allowed for you: reading this file, editing that order, opening the admin page.
Wondering how this was made? How we make these