Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
QA interview question
Security & accessibilitySeniorCommonTest design

How would you test an authorization-code flow with PKCE?

Answer

Verify exact registered redirect handling, unpredictable state and nonce where applicable, one-time short-lived authorization codes, and a valid verifier for the original challenge. Test missing, wrong, replayed and intercepted codes; issuer and audience confusion; canceled consent; refresh-token rotation; logout and session mix-up across tabs. Confirm secrets and tokens never appear in URLs, logs or browser storage outside the design.

Strong answer includes

  • covers state, nonce, PKCE verifier and replay resistance
  • tests issuer, audience and redirect validation
  • checks token storage, rotation and leakage

Practical example

A test intercepts the authorization code from a network log and replays it in a second browser session after the legitimate exchange already happened; a correctly implemented flow rejects the replayed code because it was already consumed, while a buggy implementation that reuses codes issues a second valid token pair to an attacker.

#oauth#pkce#authentication#security-qa

Sources

RFC 9700 — Best Current Practice for OAuth 2.0 SecurityIETF · Current OAuth threat model, authorization flow protections and token securityOpenID Connect Core 1.0OpenID Foundation · Authentication, ID tokens, claims, issuer, audience and nonce validationOWASP Web Security Testing GuideOWASP · Web application security test coverage