I created map, web mapping application on ArcGIS Online and wanted to access map using this app (but app hosted on my server using app login). We can create web application using many default template on ArcGIS Online. we can also download source code of these JavaScript applications and can host them on own servers.
But I am not able to find any example which can guide me to modify app code to use app login.
I already know following steps:
- Register the app and get client id (app id)/client secret (app secret)
- Using POST request get access token from https://www.arcgis.com/sharing/rest/oauth2/token/
- What next? Not sure
- How to modify code in my downloaded app to access map?
- Downloaded app folder structure
@heather-zerbe-gonzago helped but I am still not successful running my map. I am using web application created by App builder and hosted it on own server. I have changed below files and using https://github.com/Esri/resource-proxy
Getting error {"error":{"code":400,"message":"Unable to generate token","details":["Unable to generate token for this server"]}} while hitting exchangePortalTokenForServerToken method in proxy.ashx file
I am able to resolve the above issue and come across another one. I am trying to access ArcGIS Online Map using web builder generated app hosted on own servers.
I am getting below error code:498 details:[] message :"Invalid Token" while app hits url https://***/arcgisdev/proxy.ashx?https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer?f=json