Single-page app cannot renew its token — the renewal call comes back saying there is no refresh token
My single-page app signs in fine and gets an access token. When that token expires, the silent renewal fails with an error saying a refresh token is missing.
The user then gets bounced to the login page, which they experience as being logged out every hour for no reason.
I upgraded the client library recently and I think the behaviour changed, because this used to work through a hidden frame without any refresh token being involved.
What changed, and what is the correct configuration now?
@spa_sami · yesterday
Strongly second the backend-for-frontend suggestion. I moved a single-page app to it after the third round of browser privacy changes broke silent renewal again, and the thing that convinced me was that it stopped being a moving target.
Token handling in the browser has been rewritten roughly every eighteen months for years: implicit flow, then authorisation code with a challenge, then silent renewal in an iframe, then refresh tokens with rotation. Each migration was work. A session cookie against your own backend has not changed at all in that time because it never depended on third-party cookies in the first place.
The cost is a server-side component you now run, and it does not suit a purely static deployment. If you already have a backend, it is much less work than it sounds — it is a proxy plus a session store.
Reply
Report