ImpCentral API access token issue


#1

We are trying to use the ImpCentral API from our servers, which are load-balanced. We share and store an access token in redis across servers. However it seems the access token is getting associated with a server somehow (IP address?) as it will work on one of our servers and not the other one (401).

Any idea what is going on here and the best way forward.


#2

@ahoughton should have the answer for that


#3

access tokens are – as you’ve found, and we should document – tied to an IP address. This is unlikely to change. There’s no limit on the number of access tokens you can create with your refresh token, though – I’d recommend having each server keep a local access token, and use a shared refresh token to manage re-auth.

There may be other options, but none that immediately come to mind.


#4

and refresh token last forever (or on a max 5 cycle)?


#5

They do. Note that if you don’t want to be suprised when they suddenly stop working – which they will as you log in / log out from various computers – you likely want to use a LoginKey instead. Same idea, long-lived, never expires, slightly more dangerous. See http://apidoc.electricimp.com/#tag/Auth.


Where is APIKEY in new IDE