I am trying to request data from a secured ESRI MapServer in my web application. I have credentials stored server-side which I use to check out a token. I then pass that token to the client and tack it on to the end of requests to the rest service.
I have tried:
- requesting a token using `referer` and passing in the url of the application. When doing this I have made sure to add the 'referer' header to the subsequent data request (as discussed here)
- obtaining the client IP address and passing that back to the server then generating a token using the `ip` parameter
In both of these cases, I am able to successfully generate a token and use it to request data in my dev environment (on localhost) but it does not work when the application is deployed to my staging site (running in an ECS cluster on AWS).
In the deployed app I am able to successfully generate a token (using referer or ip) but when I try to request data from the MapServer I get the following error:
{"error":{"code":498,"message":"Invalid token.","details":["Invalid token."]}}
Does anyone know why this may be ocurring?