Closed omni1504 closed 5 years ago
Thanks for the code snippet! I've integrated it into the published pip package. Please update your pacakage from pip and let me know if it works. (I can't test it as I don't have an FMC anymore to test against.)
Hi Dax,
Works well me for on FMC 6.3.0 - tested on a large real rule-set and I can see token properly refreshing. I would consider this issue closed, thanks for quick reply.
Amir
Hi all,
We are using FMCAPI to migrate from Checkpoint firewall, which involved bulk addition of objects to a given rule. The nature of FMCAPI is that when you "add" a destination/source network, it iterates through all FMC objects via /networkaddresses , which is quite expensive for a busy FMC with a lot of objects (but is fine). More severe issue is with token refresh -I've included a code to get token refreshed before I call something via FMCAPI , but in case of "add" operation, there are multiple GETs which you cannot control (paginated retrieval), so you get 401 errors in the middle of pagination.
Proposed fix which I have implemented on my local copy - adding a check for 401 error and refreshing token/repeating afterwards:
Regards, Amir