Skip to content
Tech Interview Prep
Technical interview guide

SSO & Federation Protocols (SAML, OIDC)

How a user authenticates once with an identity provider and gets trusted access across many applications.

Read
45 min
Practice MCQs
25
Interview Q&A
25
Edition
v5
Editorial status
Reviewed

Scope: OIDC Core 1.0, OAuth 2.0 with RFC 9700 BCP, SAML 2.0, SCIM 2.0, and NIST SP 800-63C-4 guidance current 2026-09-04.

Curated: · Written: · Reviewed:

25 questions

MCQ-6A team is hardening the authorization endpoint of their OAuth 2.0 server. Their web client is a server-side app that registers its complete callback URI, https://app.example.com/oauth/callback, and the authorization request carries that redirect_uri. Which comparison rule should the server enforce?
MCQ-3A team's SPA signs users in with OIDC and then calls their own API. The API gateway validates the bearer token's `aud` claim against its own identifier and returns 401 for any token whose `aud` is the SPA's client ID. The ID token the SPA received was issued with `aud` and `azp` both set to that client ID. Which statement best describes what the ID token is for?
MCQ-1A backend creates a session whenever it receives an access token whose `scope` contains `openid`. A pentest shows an attacker can log in with an access token that the authorization server issued to `photos-app` for the same user. The backend now also receives an ID token: JWT header `{"alg":"RS256","kid":"a1b2"}`, payload `{"iss":"https://auth.example.com","aud":"calendar-app","sub":"user-123","email":"ada@example.com","exp":1735689600,"nonce":"n-7f3a"}`. The backend's clock is 1735689500, its client ID is `calendar-app`, and it stored `nonce=n-7f3a` when it started the login. Which change fixes the session-creation flaw?
MCQ-5An OIDC client generates a random value, stores it with the session, sends it as the `nonce` parameter in the authentication request, and rejects any ID token whose `nonce` claim does not match the stored value. Which attack does this check stop?
MCQ-4A relying party shares one issuer and one JWKS endpoint with three other clients registered at the same IdP. Its callback verifies the signature against the JWKS, the exact iss, and exp, yet a token minted for one of the other clients was presented and accepted. Which check closes the gap?
MCQ-24A client validates every token it receives with one routine: signature against the authorization server's JWKS, then iss, aud and exp. The authorization server's access tokens carry the same iss and aud as its ID tokens. Which negative test best detects token substitution at this client?
MCQ-2A single-page app uses the authorization code flow with PKCE against an IdP that enforces S256 and a 60-second authorization-code lifetime. The app generates a fresh code_verifier for each authorization request but stores it in one module-level variable, `let codeVerifier`, which every new login overwrites. A user clicks login in tab A; before tab A's redirect returns, the user opens tab B and logs in there. Tab B's callback runs first and exchanges code_B with verifier_B; tab A's callback then runs and exchanges code_A with whatever the variable holds. The whole sequence takes about 5 seconds. What do the two token requests return?
MCQ-7A native mobile app is a public OAuth client: it uses a custom URI scheme as its redirect URI and holds no client secret. A malicious app on the same device registers the same scheme, so the authorization server's redirect delivers the authorization code to the attacker. The client uses PKCE with the S256 method. Why can the attacker not exchange the captured code for tokens?
MCQ-16A gateway runs one verifier per issuer. Each verifier reads the `alg` header, looks up the key by `kid` in that issuer's JWKS, and verifies with the algorithm the header names. Current state: | issuer | algorithms it currently issues | keys in its JWKS | | --- | --- | --- | | `https://a.example` | RS256 and ES256 (mid-migration; both are live) | RSA key `a-rsa`, EC key `a-ec` | | `https://b.example` | RS256 only | RSA key `b-rsa` | | `https://c.example` | HS256 only | none: shared secret, never published | Which per-issuer allowlist removes the algorithm-confusion risk without rejecting any token the issuers currently produce?
MCQ-15A multi-tenant SaaS app lets each tenant admin paste an OIDC issuer URL. On login it fetches `{issuer}/.well-known/openid-configuration`, verifies the ID token with the `jwks_uri` from that document, and accepts the token when its `iss` claim equals the `issuer` value in the same document. A tenant admin registers `https://evil.example`, whose discovery document returns `{"issuer":"https://login.bigbank.com","jwks_uri":"https://evil.example/jwks"}`. Tokens signed by evil.example's keys with `iss: https://login.bigbank.com` are accepted as bigbank users. Which change closes this?
MCQ-8Orbit (https://orbit.example) signs users in through two OIDC issuers: its own IdP at https://login.corp.example and a partner IdP at https://auth.partner.example. Orbit is registered at both with the same client_id, the same client_secret, and the single redirect URI https://orbit.example/auth/callback. Before each redirect the app stores {issuer, state} in a signed session cookie; on the callback it posts code and state plus the shared secret to the token endpoint of the issuer named in that cookie. In one incident the user chose "Sign in with Partner" at 09:41:02, the browser reached https://login.corp.example/authorize at 09:41:04 carrying the same client_id, the same redirect_uri and state=7f3a, the user signed in there, and at 09:41:26 the callback arrived as /auth/callback?code=corp_9c1&state=7f3a, which the app posted to https://auth.partner.example/token. Which change stops the code minted by the corporate IdP from reaching the partner's token endpoint?
MCQ-9Your service stores one external account per row, keyed on the `email` claim from each IdP's ID token. Two incidents: a user at `corp.example` changed their address from `a@corp.example` to `a@newcorp.example` and now has two accounts; and after you added a second IdP, `alice@example.com` at `corp.example` and `alice@example.com` at `partner.example` land on the same account. Both IdPs are OIDC-compliant and return `email_verified: true`. Which key should the account table use instead?
MCQ-21A SaaS app signs users in with OIDC, stores the ID token's sub in external_id, and has a UNIQUE constraint on email. A user changes their address at the IdP from alice@old.example to alice@new.example and signs in again; the app provisions a second, empty account. Which change removes the root cause?
MCQ-10An app accepts OIDC tokens from two configured issuers: the workforce IdP `https://login.corp.example` and a partner IdP `https://partners.example`, where each of 40 partner tenants names its own groups. The partner token behind last week's incident carried this app's client ID in `aud`, and its issuer is on the configured list. The mapping table has one row, role `admin` grants app admin, and the code reads `roles` from any accepted token. A partner-tenant user was granted app admin. Which change removes the cause?
MCQ-19A university SAML identity provider (IdP) releases email, display name and a subject identifier to all 40 of its relying parties. For 34 of them the subject identifier is pairwise: a different value per RP. For the other 6, roster-matching services that must recognize the same student across them, it is one shared stable value. A student has an account at every RP. One of the 6 roster RPs is breached and its user table (subject identifier, email, display name) is posted publicly. Using only the leaked subject identifier, how many of the student's other 39 accounts can an attacker link to this student?
MCQ-18A brokerage app (the RP) requires multi-factor authentication before a customer can change the bank account used for withdrawals. Its OIDC authorization request to the IdP carries acr_values="urn:example:loa:2" and max_age=300. The ID token that comes back has auth_time 90 seconds ago, acr "urn:example:loa:1", and amr ["pwd"]. What should the RP do with this token for the withdrawal-address change?
MCQ-11An employee's IdP account is disabled at 09:00. At 09:05 their browser still opens the internal admin dashboard without re-authenticating. Which explanation accounts for the still-working session?
MCQ-22An app exposes a SCIM 2.0 endpoint and stores its own OAuth refresh tokens in a refresh_tokens table. At 10:00 the IdP sends PATCH /Users/8f2c with {"op":"replace","path":"active","value":false}; the app sets users.active=false and returns 204. Access tokens live 15 minutes; refresh tokens live 90 days. The refresh endpoint looks up the presented token in refresh_tokens and checks expires_at, but never reads users.active. At 10:20 the client refreshes, receives a new access token, and GET /api/orders returns 200. Which statement explains the 200?
MCQ-17An RP at app.example.com uses OIDC. Logout clears the RP's session cookie and redirects to the IdP's end_session_endpoint with id_token_hint. The IdP is configured to notify rp2.example by front-channel iframe and by back-channel logout (a logout token POSTed to rp2.example's backchannel_logout_uri). The access token has 8 minutes left. A pen test finds rp2.example's front-channel iframe was blocked by the browser, and the replayed access token still returns 200 from the resource server. After logout completes, which statement is true?
MCQ-25An OIDC provider's active signing key is compromised at 14:02 UTC. The key signs ID tokens with a 1-hour expiry. Twelve relying parties cache the provider's JWKS for 24 hours and validate signatures against that cached key. The provider also issues 30-day refresh tokens. Which containment step best limits the attacker's access in the next hour?
MCQ-23A SAML 2.0 and OIDC federation service writes structured logs to a SIEM that 200 engineers can query, with 90-day retention for incident forensics. A pen test showed that an engineer holding only read-only SIEM access could mint a valid session at the IdP using data copied from the logs. The team must still reconstruct which subject authenticated, from which client, and under which policy. Which field set must the log schema stop writing?
MCQ-12The wiki SP (entityID https://wiki.example.com/sp, ACS https://wiki.example.com/saml/acs) trusts the corporate IdP's signing certificate and accepts IdP-initiated SSO, so an absent InResponseTo is not by itself a reason to reject. At 12:04:10Z a POST arrives at wiki's ACS carrying a captured payload in which the XML signature verifies against that certificate, Conditions are NotBefore 2024-05-01T11:55:00Z and NotOnOrAfter 2024-05-01T12:15:00Z, AudienceRestriction lists both https://payroll.example.com/sp and https://wiki.example.com/sp, and SubjectConfirmation Method is bearer with SubjectConfirmationData Recipient https://payroll.example.com/saml/acs. What must the wiki SP do with this POST?
MCQ-20A multi-tenant SP has one ACS endpoint. It validates SAML signatures against any configured IdP certificate, then maps the user by NameID email. 'Allow IdP-initiated' is on for every tenant. A POST arrives with no InResponseTo, Issuer=Azure AD tenant B, NameID=alice@tenantA.com, Destination=SP ACS, and a valid signature from tenant B's certificate. Tenant A has no Azure AD configuration. What should the SP do with this POST?
MCQ-13An SP validates SAML responses and, to block replay, records each assertion ID in an in-process dictionary with a TTL equal to the assertion's 5-minute NotOnOrAfter window. The SP runs on 4 nodes behind a load balancer that distributes requests round-robin with no session affinity. An attacker on a different machine captures a valid SAMLResponse and replays it 90 seconds later; the load balancer sends the replay to a different node than the one that handled the original login. What happens?
MCQ-14An IdP signs SAML assertions with certificate A and publishes its signing keys in metadata. Service providers cache that metadata for at most 6 hours before refetching. Assertions carry a 10-minute validity window, and the federation's agreed clock-skew tolerance is 2 minutes. The team plans to add certificate B to metadata, switch the IdP to sign with B, and then remove A from metadata. What is the shortest elapsed time from publishing B to safely removing A?