Accessing secure AGOL webmaps

632
3
09-19-2013 01:12 PM
AndyNorris
New Contributor III
Hi,

I've read quite a lot on this subject, but seem to have little success in making it work.

Basically I'm trying to write a simple JavaScript application that automatically loads a secure AGOL webmap.
I want to hardcode the credentials into the application so the user doesn't have to login, as users have to login to where the app will be stored anyway. 

I can't find any sample code that does this, and being a JavaScript beginner I'm going around in circles looking at the various posts on OAuth, identity manager and proxy's. 

If anyone has any examples or ideas that they can share, I would be eternally grateful!

Many Thanks,

Andy
0 Kudos
3 Replies
JeffJacobson
Occasional Contributor III
I made an application that uses a proxy to provide credentials for secure services.
https://github.com/WSDOT-GIS/ArcGIS-Routing-and-Traffic-Demo

Note that this a test and was never put into production. This might not be the "best" way to do this.
0 Kudos
AndyNorris
New Contributor III
Thanks Jeff for your example.  I was hoping to do this without using a proxy, do you know if this is possible?

Andy
0 Kudos
JeffJacobson
Occasional Contributor III
Thanks Jeff for your example.  I was hoping to do this without using a proxy, do you know if this is possible?


Not that I know of.

The problem with hard-coding the username and password is that any user of your web application can see the JavaScript code and would then have access to that information.
0 Kudos