MapViewer problems with secured services

612
4
07-03-2018 04:06 AM
by Anonymous User
Not applicable

I'm having difficulties with the MapViewer template and secured services.

I created a new app from the MapViewer template. I enabled secure sign-in in the settings, then started up the app and signed in. I chose a secured web map from the Gallery and opened it. As soon as I try to pan/zoom the map, I get a pop up that says "This request needs to be made over https". I inspected the web traffic in Fiddler, and I can see the app hit the feature service url in ArcGIS Online, which returns a 'token required' and that the "owningSystemUrl" is http://www.ArcGIS.com. The next request is to http://www.arcgis.com/sharing/rest/oauth2/token which fails with the message in the popup of the app, that the request needs to be made over https.

The only thing I could think to check was in the AGOL org settings, and for the org I had signed into, the admin setting to 'Allow access to the organization through HTTPS only' was unchecked. I enabled that, and tried again. I got the same result, but with a slightly different message: "Request not made over ssl". I noted that in Fiddler, the token request was again using http, even though the "owningSystemUrl" in the previous step had changed to https.

My question here is why does it attempt to make that request over http instead of https? I thought that the platform would always make token requests (especially to ArcGIS Online) via https by default?

0 Kudos
4 Replies
ErwinSoekianto
Esri Regular Contributor

Hey Paul, 

That is weird. 

Is this the request for the WebMap or Layers?

Are of all the layers hosted in ArcGIS Online? Or are there some hosted in ArcGIS Enterprise (Portal or Server)?

Erwin

0 Kudos
by Anonymous User
Not applicable

Hi Erwin

To answer your questions: it seems to happen when first attempting to load the web map. All the layers for the ones I was testing are hosted in ArcGIS Online.

I have some more info though that might help. If I sign out, then sign back in, the web map loads fine. It's only if I then close the app and re-open it, and then try to open the web map that I get the error message.

So it seems to be something to do with the code and workflow around re-opening the app and using the refresh token to sign back into ArcGIS Online.

Can you have a go and see if you can replicate that?

cheers,

-Paul

0 Kudos
by Anonymous User
Not applicable

I'm also getting a similar message in another app that is also based off the Map Viewer template. If I am not signed in, then sign in, I can view secure web maps. But if I then close and re-open the app, I get an error message when trying to open any of the same web maps. The error says "client_id not specified".

I'm not sure what's going on there, but when I check Fiddler traffic, the clientid is for some reason "ref.runtimeqtsdk" - not sure how that is happening or whether it's correct or not.

0 Kudos
by Anonymous User
Not applicable

Hi Paul,

May I have a little bit more information about this issue?  So you have a Map Viewer app that has a client id.  You are able to log in and access the secured web maps.  But once you closed the app and open it and log in again, you are not able to access the same secured web maps. 

1. Are you running the Map Viewer on AppStudio Desktop?

2.  The second time you opened the app, I am assuming you will be logged in automatically?  

3. Are you able to access other secured web maps on the second time you open the app?

4. If you sign out and sign in again, are you still getting the error message  "client_id not specified"? 

3. May I see the error message screenshot?

Thanks,

Tina  

0 Kudos