state parameter
A random value the client sends at the start of an OAuth flow and checks when the browser returns, binding the response to its own request.
In more detail
It stops an attacker slipping their own authorization response into the victim’s session. The client generates a fresh unguessable value per flow and rejects any response that does not return it.
Related terms
- authorization code flow — The OAuth flow in which the browser brings back a short-lived code that the client then exchanges directly with the authorization server for tokens.
- cross-site request forgery — An attack where another website makes a logged-in user’s browser send an unwanted request that carries their cookies automatically.
- cross-site request forgery — An attack where another website makes the victim's browser send a request to your site, and the browser's cookie makes it look genuine.
- replay attack — An attack where a captured valid message, such as a token or code, is sent again to repeat its effect.
Taught in
- OAuth Two And OpenID Connect — Modern API Architecture: REST, GraphQL & gRPC
- OAuth2 & OpenID Connect: Social Auth & PKCE Flows — Production Full-Stack Engineering