Skip to content

Commit 6c77f72

Browse files
Merge pull request #411 from OpenFn/webhook_auth
Webhook auth
2 parents 9ee0b60 + f3ff517 commit 6c77f72

12 files changed

+80
-0
lines changed

docs/build/triggers.md

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ real-time event-based automation.
1919

2020
![Webhook Trigger](/img/webhook_trigger.png)
2121

22+
To learn about how to add an additional layer of security to your Webhook
23+
Trigger by adding authentication, head over to our
24+
[Webhook Security](../manage-projects/webhook-auth.md) page.
25+
2226
### Cron Triggers (formerly timers)
2327

2428
`Cron Triggers` run Workflows based on a cron schedule, and are good for

docs/manage-projects/webhook-auth.md

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: Webhook Security
3+
sidebar_label: Webhook Security
4+
slug: /webhook-security
5+
---
6+
7+
This page guides you through the steps of adding an additional layer of security
8+
to your webhook.
9+
10+
## Adding a Webhook Authentication Method
11+
12+
In your OpenFn projects, you can utilize webhooks to receive data from external
13+
applications using a
14+
[Webhook Trigger](../build/triggers.md). When using a
15+
webhook, you can require external applications to authenticate before sending
16+
your project data for more security.
17+
18+
OpenFn supports Basic HTTP Authentication using username and password, and API
19+
Key Authentication using the `x-api-key` request header.
20+
21+
### Adding Authentication Via `Project Settings`
22+
23+
You can add a new Authentication Method under `Webhook Security` of your
24+
`Project Settings`. The authentication you set up here can then be used in any
25+
of your Workflows within this Project.
26+
27+
![Project Settings Webhook Security](/img/lightning_auth_project_settings.png)
28+
29+
After clicking `New auth method`, choose the type - Basic HTTP or API Key
30+
Authentication.
31+
32+
![New Auth Method](/img/lightning_choose_auth_method.png)
33+
34+
#### Basic Auth
35+
36+
For Basic Auth, give it a name, choose a username and password, and hit
37+
`Create Auth Method`.
38+
39+
![Basic Auth](/img/lightning_basic_auth.png)
40+
41+
#### API Key
42+
43+
For API Key, just choose a name, and click `Create Auth Method`. An API key is
44+
generated for you.
45+
46+
![API auth](/img/lightning_api_auth.png)
47+
48+
You can edit or delete your auth methods on this page as well.
49+
50+
// screenshot
51+
52+
Once you added an auth method to a webhook, it will show up under
53+
`Linked Triggers`.
54+
55+
![Linked Triggers](/img/lightning_linked_triggers.png)
56+
57+
![Linked Triggers](/img/lightning_linked_triggers2.png)
58+
59+
### Adding Authentication Via a Workflow
60+
61+
On your Workflows you can use the auth methods you created under
62+
`Project Settings`, or you can create a new one.
63+
64+
When you click on `Add authentication` under `Webhook Authentication`, select a
65+
(or multiple) existing method(s), or hit `Create a new webhook auth method`.
66+
Refer to the `Basic Auth` and `API Key` sections above for details on adding
67+
these.
68+
69+
Once you've added an auth method, it will show up in your Webhook Trigger
70+
configuration.
71+
72+
![Linked Triggers](/img/lightning_workflow_trigger_added.png)
73+
74+
Only requests using these required auth details will be able to send data to
75+
your Workflow.

sidebars-main.js

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ module.exports = {
104104
'manage-projects/user-roles-permissions',
105105
'manage-projects/notifications',
106106
'manage-projects/link-to-gh',
107+
'manage-projects/webhook-auth',
107108
],
108109
},
109110
{

static/img/lightning_api_auth.png

41.5 KB
Loading
73 KB
Loading
48.2 KB
Loading

static/img/lightning_basic_auth.png

39.1 KB
Loading
25.5 KB
Loading
30.7 KB
Loading
10.9 KB
Loading
19.7 KB
Loading
30.6 KB
Loading

0 commit comments

Comments
 (0)