Alerting - webhook contact point authorization header

Trying to add the x-api-key header to a webhook contact point for use with aws api gateway, but the cloudwatch logs are showing it fails because ‘API key was required but not present’. Testing with postman using the same header/api key works fine. Am I missing something simple here?

Grafana version: 9.1.6

You are missing that is a Authorization Header - Scheme and not header key, so you are sending header:

Authorization: x-api-key <API-KEY>

but you need header:

x-api-key: <API-KEY>

Webhook doesn’t support custom headers.

I would recommend to create custom authorizer (Lambda) in your API GW, where you will be checking basic auth, because basic auth is supported by Grafana webhook.

1 Like

Thanks! worked great

Another solution might be to send they key and value as a query parameter in the url instead:

https://hostname?x-api-key=API-KEY

Yes, you can use get parameters. But you will risk, that API key will be logged. For example in access logs, so it’s not very secure solution.

@jangaraj Hey, I’m getting the same error as 403 forbidden. I’m using API Key authentication with AWS API-G.
attached the configs below -

image

Hi @jangaraj , I got the same issue, I configured HTTP Basic Authentication - Username,HTTP Basic Authentication - Password, but still 401. and

.

When I try to save contact point configure , found /api/plugins/grafana-oncall-app/settings 404

Hi @rujoesmith , How did you configured it up to work?