nash4ever encountered a 401 Unauthorized error when calling their Wordpress endpoints using webhooks, displaying a “This server could not verify that you are authorized to access the document requested” error message.
simon asked if nash4ever was using the wp-discourse plugin, which they confirmed. nash4ever also noted that their X-Discourse-Instance header was set to http, which they couldn’t change, although they had set the Discourse URL to https in their WP settings.
simon suggested enabling the ‘force https’ setting on Discourse, which nash4ever did, resulting in the X-Discourse-Instance header being sent as https. However, the error persisted.
simon asked about the webhook payload URL and Wordpress version, to which nash4ever replied that their payload URL was set correctly and they were using Wordpress 4.9.3.
Ultimately, nash4ever discovered that the issue was on their side, as they had set HTTP authentication on the site due to it not being public, and apologized for wasting simon’s time.
Hi,
I would like to use webhooks but when I call my endpoints I get this error:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
<hr>
Thanks for all of your help, the problem was on my side, I forgot that I set http authentication on the site because it is not public.
I apologize for wasting your time.