Basic auth "auth" key not being passed through in webhooks

We’re attempting to authenticate our service through the “auth” key in a webhook. The problem is that the “auth” key (and it’s sub-keys “username” and “password”) are never passed to our service nor do they form the “Authorization” header for Basic Auth.

If we form the Authorization header ourselves and add it to the “headers” key inside the json file for the webhook it works, and if we use the URL schema for Basic Auth (https://username:password@domain.com/) it works, it just seems to be an issue with the “auth” key provided in the json schema for webhooks.

Has anyone else encountered this or possibly have a direction that our team needs to go to get this working. While it isn’t a critical issue (seeing all the workarounds are available) we would greatly prefer a key called “auth” be used for our authorization method.

Thanks!

Do you have the webhook .json you used excluding the sensitive information to share?

1 Like

Hey there @kennethlimcp. I’m working with @pkearney06 on this.

The webhook json we are using where “auth” info does not make it through is:

{
    "event": "glowfish_event",
    "url": "https://api.glowfi.sh/v1/cluster/",
    "requestType": "POST",
    "mydevices": true,
    "json": {"data_set": {"temp": ["{{SPARK_EVENT_VALUE}}"]}, "time": [{{SPARK_PUBLISHED_AT}}"]},
    "auth": {
        "username": "user1",
        "password": "pass1"
    }
}

The webhook json that does work for us (sent in the url instead):

{
    "event": "glowfish_event",
    "url": "https://user1:pass1@api.glowfi.sh/v1/cluster/",
    "requestType": "POST",
    "mydevices": true,
    "json": {"data_set": {"temp": ["{{SPARK_EVENT_VALUE}}"]}, "time": ["{{SPARK_PUBLISHED_AT}}"]}
}

We are using version 1.5.16 of particle-cli.

Any help appreciated.

I will test it later but gonna ping @Dave :wink:

1 Like

Thanks for the heads up, I’ll see if I can reproduce the issue here.

Thanks,
David

@Dave @kennethlimcp Either of you guys get a chance to try reproducing this issue?

I’m still seeing it on my side, and am just passing it via URL instead for now.

Thanks, Jose.

1 Like

I’m in the same boat and my API provider doesn’t allow passing that via URL parameter…

@josec - Did you finally get to the bottom of this as I have a case I want to try which also requires a username and password passed onto the site for my webhook. Is this all up and running now? If so please send through a copy of the updated .json file… would be a great help.
Thanks.
Neal.