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.
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.
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, ...
U can use the token at the end of the url like
<SPAN class="keyword token">var</SPAN> token <SPAN class="operator token">=</SPAN><SPAN class="string token">"asdasdasdasd"</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="string token">"MapServer?f=json&token= "</SPAN> <SPAN class="operator token">+</SPAN> token<SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.