[OSGeoLive] #2398: Cesium doesn't show a map with InvalidCredentials (401) error

OSGeoLive trac_osgeolive at osgeo.org
Sat Aug 6 23:27:12 PDT 2022

#2398: Cesium doesn't show a map with InvalidCredentials (401) error
 Reporter:  sanak      |       Owner:  osgeolive@…
     Type:  defect     |      Status:  new
 Priority:  normal     |   Milestone:  OSGeoLive15.0
Component:  OSGeoLive  |  Resolution:
 Keywords:  cesium     |
Comment (by sanak):

 Replying to [comment:2 darkblueb]:

 Okay, thanks for the information.

 I guess that Cesium is expiring past versions embedded access tokens.

 Current (1.94) embedded access tokens in source files are as follows.
 $ cd /var/www/html/cesium
 $ grep -zPo -R 'const defaultAccessToken\s*=\n*\s*'[^']+";*\n*' ./
 ./Build/Cesium/Cesium.js:const defaultAccessToken="eyJh...Ct7c"
 ./Build/CesiumUnminified/Cesium.js:const defaultAccessToken =
 ./Source/Core/Ion.js:const defaultAccessToken =

 So, I think the best way is that creating OSGeoLive shared account in
 Cesium site and getting access token, then set it on the application side.

 > In a tutorial it looks like the access_code has to be added before the
 Cesium Viewer is created:
 > https://cesium.com/docs/tutorials/quick-start/
 > Add this to /var/www/html/cesium/Apps/HelloWorld.html
 > {{{
 >     // Your access token can be found at: https://cesium.com/ion/tokens.
 >     Cesium.Ion.defaultAccessToken =
 >     // Initialize the Cesium Viewer in the HTML element with the
 `cesiumContainer` ID.
 > }}}
Ticket URL: <https://trac.osgeo.org/osgeolive/ticket/2398#comment:3>
OSGeoLive <https://live.osgeo.org/>
self-contained bootable DVD, USB thumb drive or Virtual Machine based on Lubuntu, that allows you to try a wide variety of open source geospatial software without installing anything.

More information about the osgeolive mailing list