ArcGIS Token

193
1
04-18-2023 04:00 AM
Wade
by
New Contributor III

Here's how I get the token.

After I get the Token in ArcGIS Enterprise, put it directly behind the service URL? token=XXXXX in this way, you can log in automatically?

 

POST /webadaptor/sharing/rest/generateToken HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

username=admin&password=test1234&client=referer&ip=&referer=https://myserver/mywebapp&expiration=60&f=json

 

 

0 Kudos
1 Reply
JeffreyWilkerson
Occasional Contributor III

If by 'login', you mean get access to the REST data on the server, then yes. If you can generate a token for a service then you can use it in the URL to access the data. For services that aren't protected, you don't need to pass the Token. Most servers are configured to not allow you to browse the REST services, so you pretty much need to know what you are looking for, but if you know the URL, and if it's protected and you have the credentials to generate a token, then you can just add the token to the URL request to the REST endpoint. For most Javascript applications that need to access protected data, setting up a proxy class to handle the token (if needed) helps.

0 Kudos