Failure to load image presigned with security token

1. A concise explanation of the problem you’re experiencing.

Image material alters URL when the URL is very long

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

I’ve created a Sandcasle script (two of the links will expire in 7 days)

You can select the image used. First two options work well, while the last option ‘Presigned URL long’ fails to display the image

If you just copy the presignedLong and navigate to it, or use it in in HTML element, it works fine. but when used as Cesium image material, it fails to load. Looking in developer console, you can see that it is trying to load image from another URL (some parts of the URL are deleted)

presignedShort was generated by signing it with IAM credentials

presignedLong was signed using security token authentication

How can it be fixed?

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

We use AWS S3 to store images in a GIS solution and generate AWS Presigned URL for to allow user’s browser to load it.

4. The Cesium version you’re using, your operating system and browser.

Cesium 1.67, 1.57

Chrome Version 80.0.3987.149 (Official Build) (64-bit), Microsoft Edge 42.17134.1098.0

Windows 10

Both options (other than the direct one) fail for me. Have they already expired?

One thing you can try to verify that this is a bug is to load the image directly, either using Resource.fetchImage:

Or by loading it with your own JavaScript code and returning an HTMLImageElement or an ImageBitmap. You can then pass that object directly to the material.

If you can verify you’re able to load it by bypassing Cesium’s URL loading we should open a GitHub issue to log this bug.