0

I'm working with the ArcGIS Server REST API in a python script. In order to access my server, I need to generate a token and put it into the https://myserverurl.com/arcgis/rest/login page, however, I'm unable to find the URL where a token is generated. This page says "To acquire this token, go to https://myserverurl.com/arcgis and enter https://myserverurl.com/arcgis/rest' for the 'Webapp URL' parameter." This link redirects me to https://myserverurl.com/arcgis/sharing/rest/generatetoken, but it is an empty page.

Some URLs I've tried include: https://myserverurl.com/arcgis/rest/generatetoken and https://myserverurl.com/arcgis/rest/authentication, among others. ESRI's documentation asks for http://gisserver.domain.com:6080/arcgis/tokens, but this is not working either.

Am I missing something?

0

two things: make sure get requests are enabled server.arcgis.com/en/server/latest/administer/linux/… and then you will have to include the username and password in the url like this: http://domain.net:6080/arcgis/tokens/generateToken?username=theusername&password=thepassword&client=requestip

0

It sounds like you have your answer to enable GET requests, but I just wanted to mention to get the url you can always make a request to the info resource to obtain the tokenServicesUrl. For example, if your domain is gis.your-domain.com, you can make a call like this:

http://<your-domain>/arcgis/<instance>/info?f=pjson

This will return JSON similar to this:

{
 "currentVersion": 10.31,
 "fullVersion": "10.3.1",
 "soapUrl": "http://gis.your-domain.com/arcgis/services",
 "secureSoapUrl": "https://gis.your-domain.com/arcgis/services",
 "authInfo": {
  "isTokenBasedSecurity": true,
  "tokenServicesUrl": "https://gis.your-domain.com/arcgis/tokens/",
  "shortLivedTokenValidity": 480
 }
}

Then to actually obtain the token, hit the tokenServicesUrl with your credentials.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.