Autogenerate a token for ArcGIS 9.3 and 10.X

المشرف العام

Administrator
طاقم الإدارة
I'd like to autogenerate a token with, so my js/jquery-application can access the admin REST API.
This is how far I have come:

function sendTokenRequest(name) { var data = "password=..&f=pjson&csrfPreventToken=&username=..&client=..&referer=&ip=&expiration=..&encrypted=true"; var url = "http://" + name + _tokenURL; var jqxhr = $.post( url , data , function (response) { var endocedResponse = JSON.stringify(response); alert(response); }) .fail(function (why) { alert(why); }); }
The response is either this error:

{ "status": "error", "messages": ["client id type is invalid."], "code": 500 } or this error:

{ "status": "error", "messages": ["unable to decrypt request params."], "code": 500 } Is there a way to autogenerate tokens?



أكثر...
 
أعلى