Hello,
I am running a local TerriaJS-based application (TerriaMap) in development mode (yarn gulp dev, Node v20.19.0). The application loads correctly, but Cesium World Terrain fails with a 401 error.
Console error:
GET https://api.cesium.com/v1/assets/1/endpoint?access_token=...
401 (Unauthorized)
Response: {"code":"INVALID_TOKEN","message":"Invalid access token"}
TerriaJS then switches to EllipsoidTerrainProvider and shows “Terrain Server Not Responding”.
What I have verified:
-
Created a brand-new Cesium ion token.
-
Enabled access to Cesium World Terrain (asset 1).
-
Replaced the token in the application.
-
Restarted the dev server.
-
Hard refreshed the browser (Ctrl+Shift+R).
-
Confirmed in the browser console that:
window.CESIUM_ION_ACCESS_TOKENreturns exactly the same token string shown in the ion dashboard.
The token used in code and the token returned at runtime are identical.
However, the terrain request still returns:
{"code":"INVALID_TOKEN","message":"Invalid access token"}
Questions:
-
Under what conditions would a token that matches exactly still return INVALID_TOKEN?
-
Is there any server-side delay or validation state after generating a new token?
-
Is there a recommended direct API call to validate whether a token is active and authorized for asset 1?
-
Could TerriaJS be modifying the request in a way that affects token validation?
Any guidance on isolating whether this is an ion token issue, asset permission issue, or integration issue would be helpful.