Stripe -403 authentication credentials not provided

Advertisements

I am working on an application where I am using Stripe to process my payments. I have tested each and everything in test mode but when I switch to live mode I am facing errors on my web hooks and the error rate is 100% the possible explanation that Stripe returns is:
{
"detail": "Authentication credentials were not provided."
}
The status code is: 403.

>Solution :

Check your API keys if that’s not the case the possible error could be because of csrf_token as the error "Authentication credentials were not provided" is not being returned by Stripe it is your server issue.

Add this to your webhook:

@csrf_exempt
def my_webhook_view(request):
 payload = request.body
 event = None

This will resolve your issue.

Leave a ReplyCancel reply