Authentication vs Authorization на собеседовании системного аналитика
Карьерник — Duolingo для аналитиков: 10 минут в день тренируй SQL, Python, A/B, статистику, метрики и ещё 3 темы собеса. 1500+ вопросов в Telegram-боте. Бесплатно.
Authentication
AuthN. Кто are you?
Verify identity:
- Username + password.
- 2FA.
- Biometric.
- Certificates (mTLS).
- OAuth flow → identity provider.
Result: «User is Alice (id 42)».
Authorization
AuthZ. Что can you do?
After AuthN — permissions check.
- Can Alice read order #100?
- Can Alice create orders?
- Can Alice access admin panel?
Returns: allow / deny.
Common confusion
«Login» — actually two phases:
- AuthN — verify password / token.
- AuthZ — load roles / permissions.
В REST API:
- 401 Unauthorized. AuthN failed (no / invalid token).
- 403 Forbidden. AuthZ failed (token valid, но no permission).
Models
ACL. List users / permissions per resource.
RBAC. Roles assigned permissions, users assigned roles.
ABAC. Attribute-based — policies evaluate context (time, location, role, resource attrs).
ReBAC. Relationship-based (Google Zanzibar). «User can edit doc если they're owner или member team_X».
В практике — RBAC most common. ABAC growing для complex.
Implementation
JWT в auth. Token contains identity claims (sub: user_id) + roles.
Server validates signature → trusts claims.
AuthZ middleware checks roles vs required.
@requires_role("admin")
def admin_dashboard():
...Service mesh / API gateway часто handle auth централизованно.
Связанные темы
- JWT для SA
- OAuth 2.1 flows для SA
- RBAC vs ABAC для SA
- API Gateway и BFF для SA
- Подготовка к собесу системного аналитика
FAQ
Это официальная информация?
Нет. Статья основана на стандартных security practices.
Тренируйте системный анализ — откройте тренажёр с 1500+ вопросами для собесов.