Select to view content in your preferred language

Pulled private Web Map, but do not have access to Feature Layers.

469
1
Jump to solution
09-22-2023 12:43 PM
TristanG
New Contributor II

I have a private Web Map, that I am trying to access through JavaScript, I created an application to get the OAuth id's and tokens. When the Map loads in, it can get to the base map, but it cannot get the private feature layers that are part of the Web Map.

0 Kudos
1 Solution

Accepted Solutions
Sage_Wall
Esri Contributor

Hi @TristanG,

Application authentication is intended to access location services and not private content. You also never want to add your client secret to client side code.  Doing so will would allow users who might inspect your application with developer tools to steal your client secret.  Only the app id should be used client side.  More details on application authentication and the limitations are located here. 

https://developers.arcgis.com/javascript/latest/secure-resources/#app-credential-authentication

If you want to avoid having your users sign in an still share private content I'd suggest setting up and using network credentials.

https://developers.arcgis.com/javascript/latest/secure-resources/#network-credentials

Hope this helps 🙂

View solution in original post

1 Reply
Sage_Wall
Esri Contributor

Hi @TristanG,

Application authentication is intended to access location services and not private content. You also never want to add your client secret to client side code.  Doing so will would allow users who might inspect your application with developer tools to steal your client secret.  Only the app id should be used client side.  More details on application authentication and the limitations are located here. 

https://developers.arcgis.com/javascript/latest/secure-resources/#app-credential-authentication

If you want to avoid having your users sign in an still share private content I'd suggest setting up and using network credentials.

https://developers.arcgis.com/javascript/latest/secure-resources/#network-credentials

Hope this helps 🙂