AuthN vs AuthZ & The Classic IDOR Bug
**Authentication (AuthN)** proves *who you are* (`user_id = 42`). **Authorization (AuthZ)** decides *what you are allowed to touch*. Mixing them up causes the #1 API vulnerability on the OWASP list: **Broken Object-Level Authorization (BOLA / IDOR)**.
User 42 logs in legitimately, receives a valid JWT, and simply edits the URL from `GET /invoices/1042` to `GET /invoices/1099`. Because the handler only checked `isAuthenticated()` and forgot to verify ownership, it returns another customer’s private invoice!
watch:Never rely on random UUIDs alone to prevent IDOR ("security through obscurity"). Every single data fetch must enforce an explicit authorization check.