Search code examples
paypal-ipnhttp-status-code-401django-paypal

Using Django-PayPal - PayPal IPN getting 401


I'm trying to setup Django-Paypal and have got as far as the return from PayPal. To cut a long story short, in my Apache access logs, I get the following whenever I process a payment through PayPal (and PayPal POSTs the result back to my server):

173.0.82.126 - - [27/Oct/2012:16:42:52 +0200] "POST /my/super/secret/notify/url/ HTTP/1.0" 401 787 "-" "-"

The notify view does have @csrf_exempt for the purpose of troubleshooting this error and still it doesn't work.

If anyone can tell me how to solve this issue (which is clearly a permissions/authorization issue), I'd be very grateful!

P.S.: I've tried adding WSGIPassAuthorization on to my apache config file, which also didn't help.


Solution

  • Turns out, I was being very dim.... We had Basic Authentication on the server to keep out prying eyes until launch, so of course PayPal was being rejected with a 401.....

    So the answer of course is to remove the Basic Authentication while testing the IPN - all clear!

    Amazing how stepping back from something for a bit reveals the most glaring (and simple) of mistakes.