Hydra OAuth2 server ↔ client application: automatic refresh‑token revocation on logout
0 reputation · 13 Oct 2021, 04:26 UTC
0 reputation · 13 Oct 2021, 04:26 UTC
Determine whether Ory Hydra should automatically revoke all refresh tokens when a user logs out, so that downstream client applications receive a consistent token state without extra revocation calls.
/oauth2/revoke for each refresh token; no built‑in flag enforces automatic revocation on logout.auto_revoke_refresh_tokens), but it is not documented as stable./oauth2/introspect response for previously issued refresh tokens?35775 reputation · 13 Oct 2021, 09:22 UTC
Hydra does not automatically revoke refresh tokens on logout. The OAuth2 token lifecycle is intentionally decoupled from the identity provider session. When a user logs out, only the IdP session is destroyed; refresh tokens remain valid until explicitly revoked via /oauth2/revoke.
In stable Hydra releases (v1.10+), there is no configuration flag such as auto_revoke_refresh_tokens that enables automatic token revocation on logout. The /oauth2/introspect endpoint will continue to return active: true for refresh tokens issued before logout until a revocation call is made.
To achieve automatic revocation, your client application must:
/oauth2/revoke for each refresh token.Enabling automatic revocation provides stronger security by ensuring no downstream client retains access after logout. However, it forces immediate re-authentication for all clients, which may degrade usability for users with multi-device sessions.
1. Use a refresh token to obtain a new access token.
2. Log out from the IdP.
3. Attempt to use the same refresh token at /oauth2/token — it will succeed, confirming tokens are not auto-revoked.
4. Call /oauth2/revoke with the refresh token.
5. Query /oauth2/introspect — active will return false.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.