Webhook
In web development, a webhook is a method of augmenting or altering the behavior of a web page or web application with custom callbacks. These callbacks may be maintained, modified, and managed by third-party users who need not be affiliated with the originating website or application. In 2007, Jeff Lindsay coined the term webhook from the computer programming term hook.[1]
Function
[edit | edit source]Webhooks are "user-defined HTTP callbacks".[2] They are usually triggered by some event, such as pushing code to a repository,[3] a purchase, a comment being posted to a blog[4] and many more use cases.[5] When that event occurs, the source site makes an HTTP request to the URL configured for the webhook. Users can configure them to cause events on one site to invoke behavior on another.
Common uses are to trigger builds with continuous integration systems[6] or to notify bug tracking systems.[7] Because webhooks use HTTP, they can be integrated into web services without adding new infrastructure.[8]
Authenticating the webhook notification
[edit | edit source]When the client (the originating website or application) makes a webhook call to the third-party user's server, the incoming POST request should be authenticated to avoid a spoofing attack and its timestamp verified to avoid a replay attack.[9] Different techniques to authenticate the client are used:
- HTTP basic authentication can be used to authenticate the client.[10]
- The webhook can include information about what type of event it is, and a shared secret or digital signature to verify the webhook.
- An HMAC signature can be included as an HTTP header. GitHub,[11] Stripe[12] and Facebook[13] use this technique.
- Mutual TLS authentication can be used when the connection is established. The endpoint (the server) can then verify the client's certificate.[14]
The sender may choose to keep a constant list of IP addresses from which requests will be sent. This is not a sufficient security measure on its own, but it is useful for when the receiving endpoint is behind a firewall or NAT.
See also
[edit | edit source]References
[edit | edit source]- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).]
- ^ About Webhooks - Github Help
- ^ WordPress Webhooks
- ^ Use Cases for Webhooks
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Google Project Hosting - Post-Commit Web Hooks
- ^ What are WebHooks and How Do They Enable a Real-time Web?
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).