From: https://docs.particle.io/reference/api/#create-a-webhook
I'm creating a webhook with basic authentication. Using the curl parameter:
-d auth='{"username":"username","password":"password"}'
but the webhook is generating the error message: "no auth mechanism defined"
Based on the response from these posts I'm fairly certain that the particle cloud isn't really ready for any business critical applicatons.
I’m in the same boat and my API provider doesn’t allow passing that via URL parameter…
@bitwisekaizen - can you tell me how you got your webhooks to use a basic auth credentials? I have got a simple GET webhook but require data from behind a simple logon screen. Do you know how to do this easily enough?
Thanks!
Neal.
It worked for me in the following case. Here’s the webhook:
{
"event": "test4",
"url": "http://requestb.in/1j59x3i1",
"requestType": "POST",
"auth": {
"username":"testuser",
"password":"secret"
},
"json": {
"name": "{{PARTICLE_EVENT_NAME}}",
"value": "{{PARTICLE_EVENT_VALUE}}"
},
"mydevices": true,
"noDefaults": true
}
I generated the publish using:
particle publish test4 testing --private
Here’s what arrived at request bin:
The authorization header was:
Authorization: Basic dGVzdHVzZXI6c2VjcmV0
Doing the Base64 decode I get:
test user:secret
More webhook information here: https://github.com/rickkas7/particle-webhooks
Good to know it’s possible. It looks like my issue is from particle.io escaping json passed in an application/x-wwww-form-urlencoded value. The whole message must be converted to json if you want to use any of the properties which accept an object child. This makes their documentation rather pointless as it focuses on curl.