Hi y'all,
I'm setting up a webserver (Flask) to run as an endpoint for webhooks sent from AGOL but I'm having trouble verifying the secret when I receive the request.
So far, the endpoint works fine and does everything I want it to when I don't verify the secret that was sent with the webhook. However, I can't actually solve the secret due to the way Flask interprets the request from AGOL. The main issue being the x-esriHook-Signature header gets captured in the request.form object and not the request header. So what ends up happening is the signature is included with the data in an immutable multidict... which means if I try to create a new hmac, it's going to give me the wrong secret because the secret is included with the data. I've tried converting the immutable multidict data object to a regular python dict and popping the signature from the dict leaving just the request body, but that didn't help either.
I contacted technical support but they claimed that they don't support Flask which is hard to believe considering it's the second most popular Python web framework.
Has anyone else been able to verify webhook secret/signatures in Flask?