bolt-python icon indicating copy to clipboard operation
bolt-python copied to clipboard

Receiving Invalid request signature detected

Open manish001in opened this issue 5 months ago • 8 comments

Hey team, So, I am receiving the Invalid request signature detected. In last few days, it has become very common! I have made a change to my system where the event that I get is responded with ack() and then I use FastAPIs background tasks to run the business logic and processing for the message event.

Weirdly this does not happen for each event, only few events! In the background tasks, I use the event_context to call apps.event.authorizations.list api endpoint.

I am not sure why this issue is emerging. Does the event_context also expire?

Reproducible in:

The slack_bolt version

slack_bolt==1.20.1 slack_sdk==3.32.0

Python runtime version

Python 3.11.6

OS info

Amazon Linux release 2023.5.20240903 (Amazon Linux) #1 SMP Tue May 21 16:54:42 UTC 2024 (Paste the output of sw_vers && uname -v on macOS/Linux or ver on Windows OS)

Steps to reproduce:

Expected result:

I should not get intermittent issues with Invalid Request signature.

Actual result:

This is one log:

slack_bolt.RequestVerification INFO Invalid request signature detected (signature: v0=7701e8a900b2793475c41e3c65804eaa72c3d0dfbd1445335339adaac9c2e9ba, timestamp: 1725954559, body: {"token":"6J0cNanPs4p2KjLVavCwXYBk","team_id":"<>","enterprise_id":"<>","context_team_id":"<>","context_enterprise_id":"<>","api_app_id":"<>","event":{"subtype":"bot_message","text":"Alert: Content is Passed for whatsapp request, external","type":"message","ts":"1725954555.694759","bot_id":"<>","blocks":[{"type":"rich_text","block_id":"N0ar","elements":[{"type":"rich_text_section","elements":[{"type":"text","text":"Alert: Content is Passed for whatsapp request, external "}]}]}],"channel":"<>","event_ts":"1725954555.694759","channel_type":"channel"},"type":"event_callback","event_id":"Ev07L9HBMQ7R","event_time":1725954555,"authorizations":[{"enterprise_id":"<>","team_id":"<>","user_id":"<>","is_bot":false,"is_enterprise_install":false}],"is_ext_shared_channel":false,"event_context":"4-eyJldCI6Im1lc3NhZ2UiLCJ0aWQiOiJUMTkzVFNaRkUiLCJhaWQiOiJBMDU1ME01N0NTWCIsImNpZCI6IkMwN0MwTkVSVzZSIn0"})

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

manish001in avatar Sep 10 '24 09:09 manish001in