The "api.unity.com redirected you too many times" error in Unity Hub is caused by stale or corrupted embedded browser data or outdated tokens.json, leading to a redirect loop. To fix it, fully quit Unity Hub, delete specific cache, cookies, and token files depending on your OS (Windows, MacOS, or Linux), then reopen and sign in again. Proxy, VPN issues, or incorrect system time may also affect authentication.
Cause:
The error, "api.unity.com redirected you too many times" (ERR_TOO_MANY_REDIRECTS), is triggered by stale or corrupted data in Unity Hub's embedded browser (cookies, service worker, cache) or an outdated tokens.json. This invalid state creates a redirect loop. Clearing the Hub's web data and tokens resets authentication, allowing a fresh sign-in to succeed.
Resolution:
Select your OS to proceed to the resolution for your platform:
Windows
- Fully quit Unity Hub:
- Right-click the Unity Hub icon in the system tray and select Quit Unity Hub.
- Confirm no Hub processes are running in Task Manager.
- Delete embedded browser data:
- Remove the following directories (paste the following paths into File Explorer):
%AppData%\UnityHub\Service Worker%AppData%\UnityHub\Cache%AppData%\UnityHub\Cookies%AppData%\UnityHub\Network Persistent State%AppData%\UnityHub\Code Cache
- Remove the following directories (paste the following paths into File Explorer):
- Remove saved tokens (if present):
- Delete
C:\ProgramData\Unity\config\tokens.json
- Delete
- Reopen the Hub and sign in again.
MacOS
- Fully quit Unity Hub:
- Right-click the Unity Hub icon in the menu bar and select Quit.
- Ensure no Hub processes are running in Activity Monitor.
- Delete embedded browser data:
- Open Finder, press Shift+Cmd+G, and go to
~/Library/Application Support/UnityHub/- Delete:
Service WorkerCacheCookiesNetwork Persistent StateCode Cache
- Delete:
- Open Finder, press Shift+Cmd+G, and go to
- Remove saved tokens (if present):
- Go to
/Library/Application Support/Unity/config/(System Library) - Delete
tokens.json
- Go to
- Reopen the Hub and sign in again.
Linux
- Fully quit Unity Hub:
- Close the Hub and ensure no UnityHub processes are running (e.g.,
ps aux | grep UnityHub).
- Close the Hub and ensure no UnityHub processes are running (e.g.,
- Delete embedded browser data:
- Navigate to
~/.config/UnityHub/ - Delete:
Service WorkerCacheCookiesNetwork Persistent StateCode Cache
- Navigate to
- Remove saved tokens (if present):
- Navigate to
/var/lib/unity/config/(or/usr/share/unity/config/on some distributions) - Delete
tokens.json - If not found, also check
~/.local/share/unity/config/and removetokens.jsonif present.
- Navigate to
- Reopen the Hub and sign in again.
Notes and tips
- If the folders or tokens.json do not exist, proceed with the remaining steps.
- Do not delete other Unity configuration files.
- Corporate proxies, VPNs, or SSL inspection can also exacerbate redirect issues. If you still see the error after clearing data, temporarily deactivate VPN/proxy or safelist Unity domains and try again.
- Ensure your system time and time zone are correct; significant clock skew can cause authentication failures.