When I use the Connect button in Unreal Engine for Cesium, I am brought to a webpage and click on the Allow option for permissions. However, I consistently get an error saying it’s not authorized and I can’t connect the two services.
I have tried using the token from my account and pasting it into the Cesium Ion Access Token field in the project settings but that didn’t fix the problem. Any help would be really appreciated!
Cesium for Unreal authenticates to Cesium ion using OAuth2, and in order for the OAuth2 process to work it needs to be able to temporarily run a web server on a random port, and then your web browser needs to be able to connect to it. An overzealous firewall of some sort could potentially interfere with this process.
Thanks, your screenshots indicate that your web browser is able to access the Cesium for Unreal web server running on localhost. The next step is that Cesium for Unreal will send an HTTP POST request to api.cesium.com. Most likely that request is failing for some reason, but it’s hard to say why. I wrote an issue to provide more information in the error message:
Can you think of any reason your system would block a POST? It will be a cross-origin request, so perhaps if your system administrators have turned off CORS support entirely? I suspect that would break a lot of sites, though.
I seem to be in the same boat. @kpurachev By any chance are you also using a vpn? Is there a spot within Cesium to fill in proxy information like the epic games launcher has? @Kevin_Ring
Cesium for Unreal uses Unreal Engine’s FHttpModule to do HTTP requests. It looks like that does have proxy support, accessible from the C++ API. See SetProxyAddress:
I was surprised it doesn’t appear to be configurable in an .ini file or anything like that, though.
If your connection requires a proxy, I would expect tile requests to fail, too. When you open the Samples project, do you get a globe at all? Or maybe your network requires a proxy for POST requests but not GET requests?
If you’re up for it, you can try editing UnrealAssetAccessor.cpp to set the proxy address prior to the httpModule.CreateRequest call in UnrealAssetAccessor::post, and see if that helps.
Yes, like Brady said we solved it by setting those environment variables. I had to make a new project after setting those variables because the original one I created wasn’t working for some reason. Hope that helps @Rookie_Chris !
which looks like unable to access the cesium for unreal web server running on localhost.
I’ve tried many solutions,changing browser or IP something, but it doesn’t work.
Really appreaciate your support!
Hi @Cecile - Its possible that your local computer or network firewall is blocking the localhost IP Address. Are you able to try a different computer to double check?