Opened 8 weeks ago

Last modified 8 weeks ago

#2398 new defect

Cesium doesn't show a map with InvalidCredentials (401) error

Reported by: sanak Owned by: osgeolive@…
Priority: major Milestone: OSGeoLive15.0
Component: OSGeoLive Keywords: cesium
Cc: osgeolive@…

Description

Please see a screenshot.

The error seems to be quite similar with #2323.

Attachments (1)

cesium-invalid-credential-error.png (140.6 KB ) - added by sanak 8 weeks ago.

Download all attachments as: .zip

Change history (9)

comment:1 by sanak, 8 weeks ago

On my local macOS environment, Cesium-1.94 doesn't work with same error, but the latest Cesium-1.96 works without error, so like #2323, just upgrading Cesium from 1.94 to 1.96 may solve the issue.

comment:2 by darkblueb, 8 weeks ago

booting RC1 in qemu-kvm ; no cesium globe, only stars background

note: almost every build was checked for cesium demo here; Cesium demo screen worked every time. RC1 is the first build I have seen that does not have Cesium globe demo working.

in reply to:  2 comment:3 by sanak, 8 weeks ago

Replying to 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 =
    "eyJh...Ct7c";
./Source/Core/Ion.js:const defaultAccessToken =
  "eyJh...Ct7c":

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.

comment:1:ticket:2323:

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 = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwNjJhYTMzNS1lNzZkLTRmNWQtYmY5Zi0wYjdkYjQ2MTE4ZTYiLCJpZCI6NDc1NjUsImlhdCI6MTYxNzEzNTEzOH0.lf_WWRtP9LlyYbVSr0KdhFI4FzReQsqKQwK-vYK5BPI';
    // Initialize the Cesium Viewer in the HTML element with the `cesiumContainer` ID.

comment:4 by kalxas, 8 weeks ago

Cc: osgeolive@… added
Priority: normalmajor

comment:6 by sanak, 8 weeks ago

Thanks for creating the PR.

I googled a bit and found that access token expires next release, so it will alive until next release will be published.
https://github.com/CesiumGS/cesium/issues/8433

The default token that ships with the library is only meant for testing and expires with every version release, which is why you'll see this warning at the bottom of the screen when using it in your application:

comment:7 by kalxas, 8 weeks ago

This is fixed manually in 15.0rc1 VM

comment:8 by sanak, 8 weeks ago

Thanks! I confirmed it works correctly on the VM.
(On my local desktop environment, setting 3D acceleration off was necessary to see the globe.)

Note: See TracTickets for help on using tickets.