I have three sites setup. My local development (dev) environment, a test/qa site for broader validation of changes, and then production (prod).
For dev, the development environment is Codeigniter 4 running on a Macbook Pro and MAMP Pro. Testing Stripe here, I am using the Stripe command line and using the 'listen --forward-to' options for forward webhooks. This works just fine.
For prod, the environment is Codeigniter 4 on Linux running the LAMP stack on a cloud based virtual server. I haven't moved the Stripe code to prod yet because it isn't fully tested/validated. But I suspect it will be just fine as everything there is visible and available to all web traffic. The issue is with test....
For test, the environment is Codeigniter 4 on Linux running the LAMP stack on a cloud based virtual server. To keep prying eyes (and bots) out of the test server while we validate, I have htaccess passwords setup in the root diretory the test site resides at.
In Stripe I setup a webhook to the test server URL where the webhook code will be triggered. When I attempt to send a test webhook event from the Stripe Developer Dashboard, I am getting an error 401 returned for all events. Is the htaccess authentication preventing the webhook from being seen?
If so... what are my options?
- Install Stripe Cmd Line on the test server and set it up to "listen --forward-to" to the correct URL?
- If so, is there a way to set this up as a background process so it is always running? This test server should have the same uptime expectations as our prod server for validation purposes.
- OR, is there a way to setup authentication of the webhook?
- Others?
Any guidance is appreciated.