CesiumGS / cesium-unity

Bringing the 3D geospatial ecosystem to Unity
https://cesium.com/platform/cesium-for-unity/
Apache License 2.0
347 stars 83 forks source link

Support in Unity for Cesium ion servers running in single-user authentication mode. #449

Closed azrogers closed 5 months ago

azrogers commented 6 months ago

Requires https://github.com/CesiumGS/cesium-native/pull/841.

As described in the above ticket, we don't currently support Cesium ion Self-Hosted servers that are running in single-user authentication mode. This is inconvenient, especially since single-user mode is both the easiest to setup and the default authentication mode in Cesium ion Self-Hosted.

This PR changes the behavior of Cesium for Unity to request the current authentication mode from the /appData endpoint before connecting, ignoring the authentication flow and token options if in single-user mode.

j9liu commented 5 months ago

@azrogers I get a crash running this branch when trying to resume an ion session. I believe it's because of CesiumIonSessionImpl::Resume at line 304: this blog of code:

https://github.com/CesiumGS/cesium-unity/blob/9be3acb7ef6cee0665555c2b4913d9beb5a0c770/native~/Editor/src/CesiumIonSessionImpl.cpp#L304-L310

this->_appData is nullopt, which is causing an accessor error.

j9liu commented 5 months ago

@azrogers I'll merge this after CI passes. Thanks!