#2398 closed defect (fixed)
Cesium doesn't show a map with InvalidCredentials (401) error
Reported by: | sanak | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | OSGeoLive16.0 |
Component: | OSGeoLive | Keywords: | cesium |
Cc: | osgeolive@… |
Description
Please see a screenshot.
The error seems to be quite similar with #2323.
Attachments (1)
Change History (14)
by , 2 years ago
Attachment: | cesium-invalid-credential-error.png added |
---|
comment:1 by , 2 years ago
follow-up: 3 comment:2 by , 2 years 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.
comment:3 by , 2 years 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.
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 , 2 years ago
Cc: | added |
---|---|
Priority: | normal → major |
comment:6 by , 2 years 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:8 by , 2 years 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.)
comment:9 by , 23 months ago
Milestone: | OSGeoLive15.0 → OSGeoLive16.0 |
---|
Ticket retargeted after milestone closed
comment:11 by , 23 months ago
Priority: | major → critical |
---|
comment:12 by , 23 months ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:13 by , 20 months ago
This error happens again in build 40 today.
The latest CesiumJS release seems to be 1.104
, so upgrading 1.101
to 1.104
may be necessary.
https://github.com/CesiumGS/cesium/releases/tag/1.104
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.