CURRICULUM PREVIEWRevision 1 · Open for reviewReview the full course
CONNECTING THE PIECES8 min read

Authentication and authorization

Check identity, action, and resource separately.

Before you begindast

The idea

Authentication establishes who is calling. Authorization checks whether that identity may perform the requested action on this resource. A SaaS API should bind requests to trusted tenant membership and apply object-level checks. Deny by default when permission cannot be established.

Follow the flow

Make it concrete

This excerpt isolates the concept. Connect it to the booking API as you work through the exercise.

Focused example
text
Identity valid? → action permitted? → tenant owns resource?
Only then execute the booking operation.
Test anonymous, wrong role, wrong tenant, and valid caller.

Decisions that matter

  • Choose a control against a concrete risk and document its owner.
  • Exercise negative cases in authorized test fixtures.
  • Retain evidence at a specific revision and revisit it when the system changes.

Your turn

A user can list their own bookings but download any attachment by ID. What failed?

Reveal a worked answer

The attachment endpoint missed object-level authorization. Apply the same trusted tenant and ownership checks to downloads, exports, and indirect IDs. Add a regression test and review sibling endpoints for the same pattern.

Keep exploring

One more piece connected.

Mark this lesson complete when you can explain the idea.