Identity & API Security
Modern services rarely check a password themselves — they delegate. OAuth2 lets an app act on your behalf without your credentials, OIDC layers on the answer to who signed in, and the API is where the server decides what each caller may touch. Two questions run through everything here: authentication (who are you) and authorization (what may you do). Confuse them, trust a token you didn't verify, or let a client-supplied id decide access, and the whole boundary collapses.
The recurring lesson is that the server is the only authority. Tokens are the currency of trust, but a token is only as good as its verification: pinned algorithm, checked issuer and audience, live lifetime. And at the API layer, authorization is enforced per object, on the server — never delegated to a hidden button, a gateway filter alone, or the id the caller happened to send.
Topic map
- OAuth2 & OIDC — delegated authorization versus authentication, the authorization-code + PKCE flow,
stateand exact-matchredirect_uri,id_tokenversusaccess_tokenaudiences, JWT validation, refresh-token rotation and revocation. - API security — the OWASP API Top 10 shape: BOLA and function-level authorization, excessive data exposure, mass assignment, rate limiting, API credentials, schema validation, versioning, GraphQL, and gateway-versus-service enforcement.
Interview relevance: these two layers are where identity and API rounds live — expect "walk me through the auth-code flow and why PKCE", "how do you validate a JWT", and "why is BOLA number one on the OWASP API list". A candidate who keeps authentication and authorization distinct and always puts the check on the server stands out immediately.