Identity Manager

883
3
05-25-2017 08:46 PM
RaviKonaparthi1
New Contributor

Hi, 

I am getting the ArcGIS token from a custom REST service. Now i need to use the token to add the layer to the map. I am unable to set the credential property. Can anyone tell me how to set the token to the layer at runtime with out using Identity Manager.

Regards,

Ravi.

0 Kudos
3 Replies
EvelynHernandez
Occasional Contributor III

U can use the token at the end of the url like 

var token ="asdasdasdasd";
"MapServer?f=json&token= " + token;
0 Kudos
EvelynHernandez
Occasional Contributor III

Also i think i have seen a property in some layer (dont remember if featured or dynamic) to add the token via property, like: .... token: mytoken, ...

0 Kudos
MirHashmi
Occasional Contributor

Hello Ravi,

Create an object of class "Credential" and pass it to your layer.  You can assign the custom service URL to generate a token to its property "server". For more information please check reference of Credential class.

0 Kudos