| copyright |
|
||
|---|---|---|---|
| lastupdated | 2025-06-09 | ||
| subcollection | watson-assistant |
{{site.data.keyword.attribute-definition-list}}
{: #define-webhook-auth}
This document shows the process for configuring authentication for pre-message webhooks and post-message webhooks in {{site.data.keyword.conversationshort}}. It covers the available authentication methods and how to set them up.
{: #webhook-auth-overview}
Webhooks allow external systems to communicate with {{site.data.keyword.conversationshort}}. Authentication ensures that only authorized sources can trigger webhooks. This documentation describes the process for configuring and managing webhook authentication, which introduces an updated method for authenticating webhooks.
{: #webhook-before-you-begin}
Before you configure the webhook authentication:
- You must have write permissions in the environment.
- You must have authentication details of the target server, including token request URLs (if needed) and any secrets, such as a password or token.
{: #webhook-procedure}
-
Go to Home > Environments.
-
Select Settings
from either the Draft tab > Draft environment or the Live tab > Live environment. -
Select from either Pre-message webhook or Post-message webhook, according to what you want to define.
-
Scroll down to Webhook setup, and paste the API URL.
-
Click Edit authentication to open the Authentication set up page.
-
In the dropdown, choose one of the following options:
-
Click Save.
{: #no-authentication}
This is the default option.
{: #basic-auth}
- Enter a username and password.
{: #bearer-auth}
- Enter the bearer token.
{: #api-key-auth}
- Enter the API key name and API key.
{: #signed-jwt}
{: #oauth-20}
If you use the Scope string, it must be a space-delimited set of one or more authentication scopes defined by the target server. For example, write, read+write, email-read, and so on. {: note}
-
In Grant type, choose one of the following options:
-
Click Save.
{: #password}
-
Enter the Username of your webhook.
-
Enter the Password for your webhook service.
-
Enter the Client ID for your webhook authentication service.
-
Enter the Client secret to authenticate your webhook.
-
Enter the Token URL.
-
Enter the Refresh token URL.
-
Optional: If your service needs a scope string, enter the Scope string as defined by the target server.
-
In Client authentication, you must choose one of the following options:
- Send as Basic Auth header: Authentication credentials will be sent in the HTTP header.
- Send as Body: Authentication credentials will be sent in the request body.
-
Enter the Header prefix, for example: Bearer.
{: #client-credentials}
-
Enter the Client ID for your webhook authentication service.
-
Enter the Client secret to authenticate your webhook.
-
Enter the Token URL.
-
Enter the Refresh token URL.
-
Optional: If your service needs a scope string, enter the Scope string as defined by the target server.
-
In Client authentication, you must choose one of the following options:
- Send as Basic Auth header: Authentication credentials will be sent in the HTTP header.
- Send as Body: Authentication credentials will be sent in the request body.
-
Enter the Header prefix, for example: Bearer.
{: #authorization-code}
-
Enter the Client ID for your webhook authentication service.
-
Enter the Authorizing server URL.
-
Enter the Token URL.
-
Enter the Refresh token URL.
-
Optional: If your service needs a scope string, enter the Scope string as defined by the target server.
-
In Client authentication, you must choose one of the following options:
- Send as Basic Auth header: Authentication credentials will be sent in the HTTP header.
- Send as Body: Authentication credentials will be sent in the request body.
-
Enter the Header prefix, for example: Bearer.
-
Optional: Depending on the target server, copy the Redirect url to your OAuth app's 'Callback URL' field.
-
Click Grant Access.
-
Complete the steps on the page that presents by the granting server.
-
You are redirected back to the Assistant, and the edit modal re-opens.
-
Enter the Client secret under Client ID now that the field is visible.
{: #custom}
-
Enter the Custom grant type name of your webhook.
-
Enter the Token URL.
-
Enter the Refresh token URL.
-
Optional: If your service needs a scope string, enter the Scope string as defined by the target server.
-
In Client authentication, you must choose one of the following options:
- Send as Basic Auth header: Authentication credentials will be sent in the HTTP header.
- Send as Body: Authentication credentials will be sent in the request body.
-
Enter the Header prefix, for example: Bearer.
If you need to add custom secrets to your application, follow these steps:
-
Click Add secret +.
-
Type the Secret name and the Secret value.
-
Optional: If you want to add more secret names and secret values, click Add secret +.
-
Click Add parameter +.
-
Type the Parameter name, and the Parameter value.
-
Optional: If you want to add more parameter names and parameter values, click Add parameter +.