Authentication and authorization: OAuth 2.0, OpenID Connect and JWT – Server Side interview prep
261 interview-style multiple-choice questions on Authentication and authorization: OAuth 2.0, OpenID Connect and JWT, organized by topic: concepts, scenarios, code to read and tradeoffs, each with a short explanation. Learn the 68 key terms with the flashcards first, then test yourself.
Take the practice test · Flashcards · All study tools
What it covers
- 5.1 Authentication basics and password storage
- 5.2 MFA, passkeys and passwordless sign-in
- 5.3 Authorization models and access control
- 5.4 OAuth 2.0 roles, grants and flows
- 5.5 Access tokens, refresh tokens and revocation
- 5.6 OpenID Connect
- 5.7 SSO, SAML and federated identity
- 5.8 JWT structure and validation
- 5.9 Auth in practice: standards, attacks and account lifecycle
Key terms
5.1 Authentication basics and password storage
- Authentication
- Verifying identity
- Authorization
- Deciding what an identity may do
- Salt
- Random value mixed into a password before hashing
- RBAC
- Role-based access control
- Pepper
- Secret added to hashes, stored apart from them
- Argon2id
- Memory-hard password hash
- Password spraying
- Few passwords tried on many accounts
- k-anonymity
- Sharing only a partial hash to check privately
- PHC string
- Hash string with algorithm, parameters and salt
5.2 MFA, passkeys and passwordless sign-in
- Authentication factor
- Know, have or are
- TOTP
- Time-based one-time password
- MFA fatigue
- Push spam until a user approves
- Relying party ID
- Domain a passkey is scoped to
- Synced passkey
- Passkey backed up across devices
- Roaming authenticator
- Portable security key
5.3 Authorization models and access control
- Role explosion
- Too many narrow roles
- ReBAC
- Access from relationships between objects
- Policy engine
- Evaluates authorization rules
- PDP and PEP
- Decision point and enforcement point
- ACL
- Per-resource list of who can do what
- Capability
- Unforgeable token that grants access
5.4 OAuth 2.0 roles, grants and flows
- OAuth 2.0
- Framework for delegated authorization
- Authorization server
- Server that authenticates users and issues tokens
- PKCE
- Proof Key for Code Exchange, protecting the authorization code
- Scope
- Named permission requested by a client
- Resource server
- The API that accepts access tokens
- Public client
- A client that can't keep a secret
- Device authorization grant
- Sign-in approved on a second device
- PAR
- Parameters sent to the server before redirect
- Token exchange
- Trading one token for another
- OAuth 2.1
- Draft consolidating OAuth best practices
5.5 Access tokens, refresh tokens and revocation
- Opaque token
- Random reference looked up by the server
- Introspection
- Asking the server whether a token is active
- Bearer token
- Usable by whoever holds it
- DPoP
- Proof-of-possession for tokens
- Token family
- A chain of rotated refresh tokens
- Phantom token
- Opaque outside, JWT inside
5.6 OpenID Connect
- OpenID Connect
- Identity layer on top of OAuth 2.0
- ID token
- JWT describing the signed-in user for the client
- sub claim
- Stable unique user identifier within an issuer
- SSO
- Single sign-on across many applications
- openid scope
- Turns OAuth into OIDC
- UserInfo endpoint
- Returns claims about the user
- acr claim
- Authentication strength level
- Back-channel logout
- IdP notifies apps server to server
- FedCM
- Browser API for federated sign-in
- Pairwise identifier
- Different `sub` per app
5.7 SSO, SAML and federated identity
- SAML assertion
- Signed XML statement about a user
- SP-initiated SSO
- Sign-in that starts at the app
- SCIM
- Standard API for provisioning accounts
- JIT provisioning
- Account created at first sign-in
- Home realm discovery
- Choosing the IdP for a user
- Kerberos
- Ticket-based authentication
- Identity broker
- Middle layer between apps and IdPs
5.8 JWT structure and validation
- JWT
- JSON Web Token: header, payload and signature
- Claim
- A statement in a token, like sub, iss, aud or exp
- JWKS
- JSON Web Key Set: published public signing keys
- Refresh token rotation
- Issuing a new refresh token on every use
- Base64URL
- URL-safe Base64 without padding
- Registered claims
- Standard JWT claims like `iss` and `exp`
- Algorithm confusion
- Tricking a verifier into the wrong algorithm
- JWE
- Encrypted JSON Web Token
- PASETO
- JWT alternative without algorithm choice
- SD-JWT
- JWT with selectively disclosable claims
5.9 Auth in practice: standards, attacks and account lifecycle
- OAuth Security BCP
- RFC 9700 best practices
- Step-up authentication
- Asking for a stronger sign-in when needed
- insufficient_scope
- Bearer error for missing scope
- Device Bound Session Credentials
- Sessions tied to a device key
Sample practice questions
How should user passwords be stored?
- Encrypted with AES, so they can be decrypted when needed
- In plain text, in a separate, locked-down database table
- With a slow, salted password hash like Argon2id or bcrypt
- Hashed once with plain SHA-256, without any salt added
Answer: C. With a slow, salted password hash like Argon2id or bcrypt Slow hashes make brute-forcing stolen hashes expensive; salts defeat precomputed tables.
What makes multi-factor authentication (MFA) stronger than a password alone?
- It requires a much longer password than usual
- It asks the user to type the same password twice
- It needs proof from different categories, like know and have
- It encrypts the password in the browser before sending
Answer: C. It needs proof from different categories, like know and have A stolen password alone is then not enough.
What is role-based access control (RBAC)?
- A login method that uses fingerprint scans
- Permissions go to roles, and users are assigned roles
- Access is granted based on the caller's IP address
- Each user picks their own permissions at sign-up
Answer: B. Permissions go to roles, and users are assigned roles Attribute-based access control (ABAC) decides using attributes of the user, resource and context.
What is OAuth 2.0 designed for?
- Encrypting traffic sent between backend servers
- Delegated access to a user's resources without their password
- Storing user passwords securely on the server
- Proving the user's identity to the client application
Answer: B. Delegated access to a user's resources without their password OpenID Connect adds authentication on top of OAuth 2.0.
What is a refresh token used for?
- Refreshing the user's profile picture from the IdP
- Encrypting the access token before it's stored
- Reloading the login page after a session timeout
- Getting a new access token without signing in again
Answer: D. Getting a new access token without signing in again Refresh tokens are long-lived secrets; protect them and use rotation.
What does OpenID Connect (OIDC) add to OAuth 2.0?
- Support for sending the user's password in the redirect URL
- An identity layer: an ID token saying who the user is, plus UserInfo
- A replacement for HTTPS on the authorization server's endpoints
- A new encryption algorithm for protecting access tokens in transit
Answer: B. An identity layer: an ID token saying who the user is, plus UserInfo Request the `openid` scope to use OIDC.
What is SAML mainly used for today?
- Rate limiting requests to REST APIs
- Encrypting databases at rest on the server
- Delivering push notifications to mobile apps
- Enterprise SSO, with XML assertions passed via the browser
Answer: D. Enterprise SSO, with XML assertions passed via the browser Newer apps usually prefer OIDC, but SAML remains common with enterprise identity providers.
What are the three parts of a JWT?
- Public key, private key and certificate, concatenated in order
- Session ID, cookie and CSRF token, sent as one string
- Header, claims payload and signature, Base64URL-encoded and dot-separated
- Username, password and expiry date, joined together with colons
Answer: C. Header, claims payload and signature, Base64URL-encoded and dot-separated Anyone can decode the header and payload; the signature only proves integrity.
What is RFC 9700?
- The WebAuthn standard that defines passkeys for browsers
- The OAuth 2.0 Security Best Current Practice, published in 2025
- The original OAuth 2.0 framework specification from 2012
- The JSON Web Token specification that defines registered claims
Answer: B. The OAuth 2.0 Security Best Current Practice, published in 2025 It deprecates implicit and password grants and requires PKCE protections.
What does a salt protect against in password hashing?
- SQL injection through the login form fields
- Attackers eavesdropping on the network traffic
- Users picking short, easily guessed passwords
- Rainbow tables, and identical passwords sharing a hash
Answer: D. Rainbow tables, and identical passwords sharing a hash Each password gets its own random salt stored alongside the hash.
More Server Side
- HTTP fundamentals
- REST API design
- GraphQL
- gRPC & real-time APIs
- Sessions, cookies & web app security
- C# & .NET
- Java & Spring Boot
- Node.js & Express
- Python, Django & FastAPI
- Go (Golang)
- Concurrency & multithreading
- OOP & SOLID
- Design patterns
- Dependency injection
- Logging & observability
- Data structures
- Algorithms & Big-O
- Linux & shell scripting