ITP and browser behavior
Enabling ITP causes the browser to behave as if you had disabled third-party cookies in the browser, which makes it impossible to obtain a new token without displaying anything to the user. This is akin to the way Connect (OIDC) uses iframes for handling sessions in SPAs. In the SPA SDK (which is our recommendation)getTokenSilently
performs silent authentication unless you configure the SDK to use rotating .
Workarounds
Recent advancements in user privacy controls in browsers adversely impact the user experience by preventing access to third-party cookies. You can use Refresh Token Rotation as an alternative that provides a secure method for using refresh tokens in SPAs while providing end-users with seamless access to resources without the disruption in UX caused by browser privacy technology like ITP. Alternatively, you can work around the issues posed by ITP by using Auth0’s custom domains functionality, particularly if the lives on a subdomain of the application’s website domain. For example, if your application is hosted on example.com, the custom domain would need to be of the format subdomain.example.com.ITP debug mode
Safari Technology Preview offers an “Intelligent Tracking Prevention Debug Mode” that you can use to troubleshoot ITP issues. You can find instructions on how to debug ITP in this blog post from WebKit. NOTE: The instructions mention how to permanently classify a custom domain as having tracking abilities for testing purposes. In later versions of Safari Technology Preview, though, the domain to store the User Defaults for this setting changed fromcom.apple.SafariTechnologyPreview
to com.apple.WebKit.Networking
. If you are having trouble with the commands mentioned in the instructions, try these:
- Classify a site as having tracking abilities:
defaults write com.apple.WebKit.Networking ResourceLoadStatisticsManualPrevalentResource example.com
- Inspect the setting:
defaults read com.apple.WebKit.Networking ResourceLoadStatisticsManualPrevalentResource
- Delete the setting:
defaults delete com.apple.WebKit.Networking ResourceLoadStatisticsManualPrevalentResource