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

  1. 5.1 Authentication basics and password storage
  2. 5.2 MFA, passkeys and passwordless sign-in
  3. 5.3 Authorization models and access control
  4. 5.4 OAuth 2.0 roles, grants and flows
  5. 5.5 Access tokens, refresh tokens and revocation
  6. 5.6 OpenID Connect
  7. 5.7 SSO, SAML and federated identity
  8. 5.8 JWT structure and validation
  9. 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

  1. How should user passwords be stored?

    1. Encrypted with AES, so they can be decrypted when needed
    2. In plain text, in a separate, locked-down database table
    3. With a slow, salted password hash like Argon2id or bcrypt
    4. 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.

  2. What makes multi-factor authentication (MFA) stronger than a password alone?

    1. It requires a much longer password than usual
    2. It asks the user to type the same password twice
    3. It needs proof from different categories, like know and have
    4. 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.

  3. What is role-based access control (RBAC)?

    1. A login method that uses fingerprint scans
    2. Permissions go to roles, and users are assigned roles
    3. Access is granted based on the caller's IP address
    4. 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.

  4. What is OAuth 2.0 designed for?

    1. Encrypting traffic sent between backend servers
    2. Delegated access to a user's resources without their password
    3. Storing user passwords securely on the server
    4. 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.

  5. What is a refresh token used for?

    1. Refreshing the user's profile picture from the IdP
    2. Encrypting the access token before it's stored
    3. Reloading the login page after a session timeout
    4. 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.

  6. What does OpenID Connect (OIDC) add to OAuth 2.0?

    1. Support for sending the user's password in the redirect URL
    2. An identity layer: an ID token saying who the user is, plus UserInfo
    3. A replacement for HTTPS on the authorization server's endpoints
    4. 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.

  7. What is SAML mainly used for today?

    1. Rate limiting requests to REST APIs
    2. Encrypting databases at rest on the server
    3. Delivering push notifications to mobile apps
    4. 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.

  8. What are the three parts of a JWT?

    1. Public key, private key and certificate, concatenated in order
    2. Session ID, cookie and CSRF token, sent as one string
    3. Header, claims payload and signature, Base64URL-encoded and dot-separated
    4. 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.

  9. What is RFC 9700?

    1. The WebAuthn standard that defines passkeys for browsers
    2. The OAuth 2.0 Security Best Current Practice, published in 2025
    3. The original OAuth 2.0 framework specification from 2012
    4. 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.

  10. What does a salt protect against in password hashing?

    1. SQL injection through the login form fields
    2. Attackers eavesdropping on the network traffic
    3. Users picking short, easily guessed passwords
    4. 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.

Practice all 261 questions

More Server Side