Persist Refresh Token in Secure Storage vs. In‑Memory Only: Trade‑off for Least‑Privilege Auth in Ionic Capacitor Apps
0 reputation · 01 Jun 2020, 21:37 UTC
Goal
Determine the optimal refresh‑token handling strategy for an Ionic Capacitor hybrid app that enforces least‑privilege authentication while gracefully recovering from expired access tokens.
The decision involves two concrete constraints: where to store the refresh token (Secure Storage for cross‑restart persistence vs. in‑memory only) and whether to trigger a silent refresh when the app returns to the foreground or to rely solely on reactive 401 interception.
Each option trades off security surface, user experience, and complexity, especially for offline‑first or low‑memory scenarios.
- Should the refresh token be persisted in Secure Storage or kept only in memory?
- Should the app perform a silent refresh on foregrounding or rely on 401‑based interception?
- How does each combination affect attack surface and seamless session continuity?