Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Webhook is getting http 401

Deleted user January 7, 2020

My webhook keeps getting 401 - Unauthorized from my IIS-hosted Web API. 

The API is just a basic Web API that is configured to receive webhook events from Bitbucket, with a valid HTTPS URL, and I'm using the correct secret key.

 

WebApiConfig.cs

// Initialize Bitbucket Webhook receiver
config.InitializeReceiveBitbucketWebHooks();

 Handler

public class BitBucketWebhookHandler : WebHookHandler
{
public BitBucketWebhookHandler()
{
Receiver = BitbucketWebHookReceiver.ReceiverName;
}

public override Task ExecuteAsync(string receiver, WebHookHandlerContext context)
{
throw new NotImplementedException();
}
}

 Web.config

<appSettings>
<add key="MS_WebHookReceiverSecret_Bitbucket" value="<key>"/>
</appSettings>

 Global.asax.cs

protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
}

All the examples I see is for sites hosted in Azure. I've tried using an Azure-hosted API and it works. Unfortunately, I am required to use IIS. How can I set this up properly?

Which authentication mode should I use? I've tried using Windows, Basic, and Anonymous authentication to no avail.

 Any ideas?

1 answer

0 votes
Steven F Behnke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2020

Http 401 generally means unauthorized or logged out. 

Deleted user January 8, 2020

I looked at the IIS logs and the error is actually 401.2 which means a server configuration is preventing access. I'm not sure what configuration it's referring to, though.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events