-
Couldn't load subscription status.
- Fork 115
Description
Browser vendors are implementing increasingly strict rules around cookies.
This is increasingly problematic for SPA's with their Identity Server on a third-party domain.
Most notably problems occur if the "silent refresh via an iframe" technique is used.
This repository uses that technique currently, starting with a silentRefresh().
This will fire up an iframe to load an IDS page with noprompt, hoping cookies get sent along to so the IDS can see if a user is logged in.
Safari will block cookies from being sent, prompting a leading OAuth/OpenID community member to write "SPAs are dead!?".
In fact, if you fire up this sample repository on localhost, which talks to demo.identityserver.io (another domain!), and use it in Safari: you will notice that the silent refresh technique already fails!
Edit: starting with Chrome 83, they also have this behavior in Incognito mode.
Several prominent directions for solving this are available, and more too possibly:
- Run IDS on a subdomain where your SPA is also running (effectively making cookies first-party)
- Don't use "the iframe technique", but instead use refresh tokens with additional mitigations
- Switch to a BFF (Backend-for-frontend) setup
I'm not sure yet what route to pick for this sample, if any.