Experience Builder Authentication Question

2206
3
Jump to solution
12-07-2023 11:45 PM
bdoventures
Occasional Contributor

I have some Experiences I've created using Dev Ed 1.13, and would like to make a limited amount of data available to end users via the add data widget through a curated group.  I'm wondering if it's possible to encode credentials (this would be for a viewer account with limited permissions) into the app to allow for automatic authentication so that the resources in the curated group would not have to be set to public and users would not have to log in to AGOL.

A few notes:  I have CORS restrictions set and am serving the apps through WP shortcodes to allow them to be placed behind a login.

 

0 Kudos
1 Solution

Accepted Solutions
Grant-S-Carroll
Esri Contributor

Depending on what the workflow is, I had a scenario where I need to serve data publicly, but only to a specific application due to licencing constraints around the data .I used the built in proxy within AGOL to limit the applications that could see the data. See below for the pattern to achieve this, this will prevent the proxied layer from being viewed in any application (even ArcGIS Online if you choose) other than those specified. 

I've not tested this for the specific scenario you have described, but it might be worth a shot...

Notes below are from an internal wik, also notes are a couple of years old and I've not tried the workflow since then, but the app is still functioning as it should, but updates to AGOL may have shifted the buttons etc around a bit..

 

1. Add the layer to ArcGIS Online.
2. From the settings page of the layer, copy the URL of the layer you want to share.

GrantSCarroll_0-1702024965242.png

 

3. Add it back in to ArcGIS Online as a new item.

GrantSCarroll_1-1702025005111.png

 

GrantSCarroll_2-1702025023779.png

 

4. Paste in the copied URL and select the option to not prompt for authentication.

GrantSCarroll_5-1702025143362.png

 

 

5. Enter the username and password to use to access the data (user should be able to access, suggest using a service account).

GrantSCarroll_4-1702025088017.png

 

6. Fill out the details.

GrantSCarroll_6-1702025198762.png

 

7. Once the layer has been loaded, go to the settings section and click the Limit Usage Button.

GrantSCarroll_7-1702025222774.png

 

8. Add in the URL to the application that will be using the data. (this would be the URL of your Experience. I would then also share this (at this level, eg within the layer) to your curated group). My thinking is that if you tried to shared this via the actual group, AGOL would not be able access, and if you add in AGOL as an allowed refer, then it breaks the whole point of the operation.

GrantSCarroll_8-1702025263106.png

 

9. The layer can now be added to the application using the generated URL.

GrantSCarroll_9-1702025337879.png

 

View solution in original post

3 Replies
Grant-S-Carroll
Esri Contributor

Depending on what the workflow is, I had a scenario where I need to serve data publicly, but only to a specific application due to licencing constraints around the data .I used the built in proxy within AGOL to limit the applications that could see the data. See below for the pattern to achieve this, this will prevent the proxied layer from being viewed in any application (even ArcGIS Online if you choose) other than those specified. 

I've not tested this for the specific scenario you have described, but it might be worth a shot...

Notes below are from an internal wik, also notes are a couple of years old and I've not tried the workflow since then, but the app is still functioning as it should, but updates to AGOL may have shifted the buttons etc around a bit..

 

1. Add the layer to ArcGIS Online.
2. From the settings page of the layer, copy the URL of the layer you want to share.

GrantSCarroll_0-1702024965242.png

 

3. Add it back in to ArcGIS Online as a new item.

GrantSCarroll_1-1702025005111.png

 

GrantSCarroll_2-1702025023779.png

 

4. Paste in the copied URL and select the option to not prompt for authentication.

GrantSCarroll_5-1702025143362.png

 

 

5. Enter the username and password to use to access the data (user should be able to access, suggest using a service account).

GrantSCarroll_4-1702025088017.png

 

6. Fill out the details.

GrantSCarroll_6-1702025198762.png

 

7. Once the layer has been loaded, go to the settings section and click the Limit Usage Button.

GrantSCarroll_7-1702025222774.png

 

8. Add in the URL to the application that will be using the data. (this would be the URL of your Experience. I would then also share this (at this level, eg within the layer) to your curated group). My thinking is that if you tried to shared this via the actual group, AGOL would not be able access, and if you add in AGOL as an allowed refer, then it breaks the whole point of the operation.

GrantSCarroll_8-1702025263106.png

 

9. The layer can now be added to the application using the generated URL.

GrantSCarroll_9-1702025337879.png

 

bdoventures
Occasional Contributor

Editing my response, bc I realized that the original authentication requirement had been removed from the URL I was using to test your workflow.  I tested a different feature layer and was able to achieve the workflow.  Upon testing, I was able to both see it and load it to the map from the specified referrer, but when I tried to do the same thing from an AGOL-hosted experience, it prompted me for a login.  Given the number of layers I want to curate, this may be a little burdensome, but it appears to be a viable solution.  Thanks for the tip.

0 Kudos
Grant-S-Carroll
Esri Contributor

Ah ok, yeah, its good if you only have one or two layers, but the workflow doesn't really scale very well unfortunately. Its a good solution to have up your sleve in specific scenarios.

0 Kudos