ESRI web map: How to pass the OAuth token to fetch the web map without passing userid

2016
0
12-26-2013 09:14 PM
MaiRong
New Contributor
I'm using ESRI javascript API 3.7 for web map service. The web map is based on Oauth2 authentication. I use java code to fetch the token. Then I need to fetch the map in javascript by calling esri.arcgis.utils.createMap(). But How to pass the token with this request? I know ESRI3.7 offers a API called esri.IdentityManager.registerToken() that can pass the token will the request. But this method requires the user name as parameter. I don't want to put the username in the javascript code, as it's not safe. Are there any other ways to pass the token with the request? The api for esri.IdentityManager.registerToken() is here: https://developers.arcgis.com/en/javascript/jsapi/identitymanagerbase-amd.html#registertoken Thanks a lot.
0 Kudos
0 Replies