How to tell IP used for token generation

876
0
05-21-2018 10:39 AM
SzymonPiskula1
New Contributor III

Hello

When generating a token it is possible to set client='requestip' when making calls to the REST endpoint. Question: is it possible to tell what IP address had been detected by AGServer for which the token is valild?

I have a scenario where our multi machine site is accessed via a loadbalancer. The ELB (this is in AWS) comprises of two redundant LBs for availability reason. Then in Python I request for a token for 'request' IP, then perform a number of operations via REST. I get the token OK, i can even submit gp jobs OK and check for theirs status fine, but occasionally out of sudden my token becomes invalid for a while (its requested for 60mins, but i get the issue sometimes in couple of minutes). For a while all my request signed with the token result in:

{u'status': u'error', u'code': 498, u'messages': [u'Invalid token, ClientID does not match.']}

Then all goes back to normal, then randomly comes back, and again goes back to normal.

After capturing some network traffic i could see how requests going into AGS actually go through different LBs. Requests that come from the LB that was used to obtain the token are fine. Those that come through the other LB fail.

Is there a way to tell / get insight into what exactly arcgis server sees when request for a token comes in? Can i tell each time what is the ip address of request that is detected by the server?

We suspect this has something to do with some  X-Forwarded header setting - perhaps at LB or somewhere else?

Regards,

Szymon

0 Kudos
0 Replies