AnsweredAssumed Answered

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

Question asked by rmai on Dec 26, 2013
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: Thanks a lot.