M. Kodirov

STAGE 05 / LESSON 01

Authentication versus authorization

Knowing who a user is and deciding what they may do are separate checks.

THE IDEA

Understand it.

Authentication verifies an identity, for example through a login process. Authorization decides whether that identity can perform an action on a specific resource. Checking only that a user is logged in is not enough for private data.

For passwords, use a dedicated, modern password-hashing algorithm and a well-reviewed authentication solution. Never store plain-text passwords or invent a password hashing scheme.

SEE IT IN CONTEXT

A private task request

1. Identify the signed-in user.
2. Load task 42 using an authorized scope.
3. Check the user can read that task.
4. Return the task or a safe denial.

An authenticated user can still lack permission to read or modify another person’s task.

LEARN FROM REAL WEBSITES

See it in the real world.

These simplified structures come from public sources. Company systems change, and the sources may describe only one project or an earlier design.

GitHub

Documentation checked November 2026

Identity and app permissions

GitHub explains how clients authenticate to its REST API and how GitHub Apps request permissions.

  1. Authenticated client
  2. Granted permissions
  3. API resource

What to learn: Authentication identifies a client; authorization determines which operations that identity may perform.

Read the source: GitHub REST API authentication

Spotify

Documentation checked November 2026

Access depends on scope

Spotify documents scopes that control which protected user data an application can request.

  1. User grants access
  2. Scope
  3. Protected resource

What to learn: A logged-in user and an authorized application are different concerns: the requested operation still needs the right scope.

Read the source: Spotify authorization scopes

TRY IT YOURSELF

Practice.

Why is hiding the Delete button for non-admin users insufficient?

Show one possible answer

A user can send a request without using the UI. The server must enforce permission for the delete operation itself.

GO DEEPER

Official references.