ArcGIS Server Invalid Token 498 error from Rest API call

2962
2
03-15-2021 07:58 AM
PugazhendhiN
New Contributor

Hi All,

I am using ArcGIS Standalone GIS Server, generated token using http://server:port/arcgis/admin/generateToken with following parameters.

username: <username>

password: <password>

client: requestip

expiration: 1440

f: json

When passing the generated token along with the rest service ExportMap method in postman, I am getting 498 Invalid token error.

Any thoughts on this.

Thanks,

Pugazh

 

0 Kudos
2 Replies
by Anonymous User
Not applicable

Hi Pugazh,

Are you acquiring the token through a GET or POST request? What about the ExportMap operation?

Is your client machine (the requestip) or the ArcGIS Server machine behind a load balancer/proxy? If so, then we would have to use the IP address of the proxy server.

What is the behavior if you attempt the ExportMap operation with the token appended in the URL bar of a web browser manually?

-Calvin

JonathanQuinn
Esri Notable Contributor

Using a referrer based token is often the better approach when working with tokens, because of what @Anonymous User mentions; the IP of the request may not actually come from the machine you're making the request from. Using a referrer and including the referrer header in any requests to use the token is the preferred approach:

https://enterprise.arcgis.com/en/server/latest/administer/windows/acquiring-arcgis-tokens.htm

If there is a proxy server between the client application or browser and the ArcGIS Server site, tokens generated using the IP Address and IP address of this request's origin options must be bound to the IP address of the proxy server. If there are multiple load balancing proxy servers between the client application or browser and the ArcGIS Server, the HTTP Referer option should be used.