Skip to content

Interview question · Identity, OAuth & Access Control

What is the difference between authentication and authorization, and where does each usually fail?

Ten seconds of definition, then the part that scores: why most access bugs happen to users who logged in perfectly.

easyEssentialNewPreparation tags: Amazon, Google, MicrosoftUpdated Nov 2026

TL;DR: Authentication verifies who a principal is; authorization decides what that principal may do with a specific resource. Authentication usually fails through stolen or phished credentials and stolen sessions. Authorization usually fails through missing checks on specific objects (IDOR), missing checks on privileged functions, checks placed in the client, and stale permissions. The second category causes more breaches, because authorization must be right on every endpoint while login lives in one place.

How to approach it

Define both in a sentence each, then make the answer about failure modes with examples. Finish with the design rules that prevent authorization bugs, since that is what the interviewer will probe next.

A strong answer

FIG · AUTHN THEN AUTHZ · TWO QUESTIONS, EVERY REQUEST
Who are you, then may you do this to that

Request

GET /invoices/17

Authentication

session or token valid

Authorisation

user 42 owns invoice 17?

Resource

returned or 403

How each fails

Authentication failures

  • Phished or stuffed credentials, stolen sessions

Authorisation failures

  • IDOR: no check on this object
  • Missing role checks on admin functions

Definitions. Authentication establishes a principal by verifying a credential (password plus second factor, passkey, client certificate, signed workload token). Authorization takes the principal, the action and the specific resource and returns allow or deny, every time.

Where authentication fails.

  • Phished or reused passwords without phishing-resistant MFA.
  • Session or token theft (XSS reading tokens, tokens in logs, malware).
  • Weak recovery flows that bypass the strong login.
  • Service credentials that never expire and leak through code or CI logs.

Where authorization fails.

FailureExample
Object-level (IDOR / BOLA)GET /orders/8812 returns another customer's order
Function-levelA regular user calls /admin/users/export directly
Client-side enforcementRole taken from a hidden field or a mobile app's local flag
Tenant isolationQuery filters by object ID but not by tenant ID
Stale decisionsAccess continues after a user leaves the project
DelegationAn agent or service acts with its own broad permissions instead of the user's

OWASP's web Top 10 has ranked broken access control first since 2021, and its API Top 10 lists broken object-level authorization first. The reason is structural: every endpoint and every object needs a check, and forgetting one is enough.

Rules that work. Authorize on the server for every request; check the specific object, not just that a user is logged in; deny by default; centralise policy in a shared library or service so checks are consistent and testable; and write negative tests ("user A requests user B's object, expect 403") for every resource type.

The AI angle. An LLM feature that fetches records by an ID the model supplies is an IDOR waiting to happen. The tool must authorize against the session's user, not trust the model's arguments.

What interviewers probe next

  • "How would you find IDORs across a large API?" Automated tests with two users per resource type, plus reviewing that every data access goes through the authorization layer.
  • "Where should authorization logic live in microservices?" In a shared policy engine or library called by each service, with the decision made close to the data.
  • "Is MFA an authorization control?" No, it strengthens authentication; it does nothing for a missing ownership check.

What if?

What if · interview follow-ups

Hold your answer as the constraints change

A logged-in user of a project-management app opens /projects/42/settings, a project they do not belong to, and the page loads.

  1. Start here

    Which control failed here?

How it's scored

Weak: Gives definitions only, or conflates the two ("they're logged in, so they're authorized").

Hire: Gives distinct failure modes for each with examples, emphasising object-level authorization.

Strong Hire: Explains why authorization fails more often, gives preventive design rules and tests, and extends to agents and delegated access.

Common mistakes

  • Treating authentication as sufficient protection for data.
  • Enforcing roles in the frontend.
  • Forgetting tenant boundaries in multi-tenant queries.
  • Letting model-supplied identifiers select data without checks.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 10, and we keep track of how far you get in every topic.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in doubles your free answers, from 5 to 10 per topic, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

No comments yet. Share a correction or a different way to answer it.