Hi Bubble Community,
I’m working on integrating Fluidpay’s (Payment Processing Gateway) webhooks into my Bubble application to handle subscription-based transactions. I’ve successfully set up the webhook in Fluidpay and created an API endpoint in Bubble. I’ve also used the “Detect Data” button in Bubble, which confirmed that Bubble can receive the webhook payload.
However, I have a concern about the security aspect of verifying the HMAC SHA 256 signature that Fluidpay includes with each webhook request.
Current Setup:
-
Webhook Configuration in Fluidpay:
- I’ve configured the webhook in Fluidpay to point to my Bubble API endpoint.
- The webhook is set to trigger on transaction creation.
-
API Endpoint in Bubble:
- I’ve created an API workflow in Bubble to handle the incoming webhook data.
- The endpoint successfully detects and processes the webhook payload.
Security Concern:
Fluidpay’s documentation mentions that each webhook request is sent with a header “Signature” that is HMAC SHA 256 signed and then base64 URL encoded. To verify webhook post signatures, the “Signature” header must be decoded and checked using the HMAC SHA 256 algorithm with a secret key.
Here is the relevant excerpt from Fluidpay’s documentation:
Here’s the full documentation: Webhooks
Questions:
-
Does Bubble handle HMAC SHA 256 signature verification natively?
- If not, what are the best practices for implementing this verification to ensure security?
-
Steps to Implement External Verification:
- I understand that using AWS Lambda (or a similar service) can help with this verification. Here are the steps I’m considering:
- Set Up AWS Lambda Function:
- Create a Lambda function that receives the webhook request, verifies the HMAC SHA 256 signature, and then forwards the verified request to Bubble.
- Update Fluidpay Webhook URL:
- Point the Fluidpay webhook to the Lambda function endpoint.
- Forward Verified Requests to Bubble:
- Ensure the Lambda function forwards only verified requests to the Bubble webhook endpoint.
- Set Up AWS Lambda Function:
- I understand that using AWS Lambda (or a similar service) can help with this verification. Here are the steps I’m considering:
Current Attempt:
I have attempted the following setup based on my understanding:
- Added a parameter in Bubble’s API workflow to check the
response_code
and ensure it’s only processing successful transactions. - Configured the webhook in Fluidpay and tested connectivity successfully.
Request for Assistance:
Any insights, examples, or guidance on securely verifying Fluidpay webhooks in Bubble would be greatly appreciated. If you have experience with similar setups or can point me to relevant resources, that would be incredibly helpful.
Thank you in advance for your support!
Trevor