Accessing webmap within iframe using Oauth

Greetings community!

As part of my dissertation for my university, I have created a webmap using ArcGIS.

I have then shared this map (made it public), with the url being: uthess.maps.arcgis.com/home/item.html?id=d9f848d334514bc1a57087657ea7b91e

The corresponding url for ArcGIS REST Services Directory is: services3.arcgis.com/dNdWqmajbLxVlc02/arcgis/rest/services/AllERT_Map_WFL1/FeatureServer

 

My goal is to view the map in a Node-Red dashboard inside an iFrame.

When I set the iFrame’s URL to: www.arcgis.com/apps/mapviewer/index.html?url=https://services3.arcgis.com/dNdWqmajbLxVlc02/A…

The map is shown, but since the user is not logged in, I cannot access some of its functionalities that I need (routing, for example).

 

If I use the url (outside node-red) using the university domain url: uthess.maps.arcgis.com/apps/mapviewer/index.html?url=https://services3.arcgis.com/dNdWqmajbL…, I am redirected to the university’s login page and when I login, I get the map with its full functionality.

 

So, I need this done programmatically so I can automate the login procedure.

Thus, I must first request an auth token using my university credentials, and then use this token along with the url, so that the map is shown in the iframe through the university domain url (uthess.maps.arcgis.com/apps/mapviewer/index.html?url=https://services3.arcgis.com/dNdWqmajbL…) with the user logged in and all the map functionalities available.

 

I have been trying to utilize the developers.arcgis.com/ and the community.esri.com/, tried the older generateToken and the OAuth Token, but got no results.

 

Can someone aid me and guide me in the right direction please?

 

Thank you in advance

Kind Regards

Demie

Read more here: Source link