I'm using the code below to try to show a WebScene. When I run it, though, I get a 403 error. In the network console, the request URL is shown as https://<myHostName.myDomain>/portal/sharing/rest/content/items/<webSceneID>. If I go to that URL in my browser, I also get a 403 error, though if I append my token (the same one used in the code) using ?token=<my token> at the end of that URL, I get an informational page about the Web Scene in our portal.
Do I need to do something else in my code to give me access to the WebScene in our portal, or does something need to be differently configured on the portal or the server hosting it? Note that I can use my token to add feature layers we have in our portal to a new WebScene created with a basemap, instead of a portalItem, and that works fine.
IdentityManager.registerToken(TOKEN);
esriConfig.portalUrl = "https://<myHostName.myDomain>/portal";
const scene = new WebScene({
portalItem: {
id: "<the ID of the WebScene in the portal>"
}
});
const view = new SceneView({
container: "viewDiv",
map: scene,
center: [-121.60681, 39.7592],
zoom: 12
});