Select to view content in your preferred language

Access to portal private contents in experience deployed as webapp

354
1
Jump to solution
03-04-2025 01:35 AM
Labels (1)
LorenzoFerrari
Emerging Contributor

Hello, I am studying how to publish an experience as a web app through a web server. Thanks to a quick test using npm serve, I am able to publish the experience, but I am having issues accessing private content stored in the portal.

From what I read in the documentation, it should be enough to specify the OAuth 2.0 key created on the portal in config.json, inside the attributes object, to allow the experience to authenticate with the portal using the same privileges as the key creator.

imm2.JPG

However, this step does not seem to work because if I set the web map used by the Map widget as private, the application immediately prompts me to log in. Additionally, the experience includes an Add Data widget where importing from the portal (via curated Groups) is enabled, but no items are displayed there either.
imm1.JPG

In my Experience Builder developer environment, I did not encounter these issues. What am i doing wrong? Maybe, since "npm serve" uses HTTP instead of HTTPS, the experience is not able to authenticate with the portal?

Thank you

0 Kudos
1 Solution

Accepted Solutions
Wei_Ying
Esri Regular Contributor

Hi,

Thanks for your feedback. Login is required to access your recourses from your portal, even a clientID is is added to the app config.json. Because it needs to verify who you are when accessing the app. After login that is you provide your authentication you should be able to see the data.   

View solution in original post

1 Reply
Wei_Ying
Esri Regular Contributor

Hi,

Thanks for your feedback. Login is required to access your recourses from your portal, even a clientID is is added to the app config.json. Because it needs to verify who you are when accessing the app. After login that is you provide your authentication you should be able to see the data.