Skip to content

Commit 427315c

Browse files
committed
Add information about authentication and validation to README
1 parent 905e191 commit 427315c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ $ cp .env.example .env
5151
| CALL_ANNOUCEMENT_LANGUAGE | The language to speak announcements in. | "en" or any of the [supported languages](https://www.twilio.com/docs/voice/twiml/say#attributes-language). |
5252
| OUT_OF_SESSION_MESSAGE_FOR_CALL | A message to play if someone calls the number pool without an active session. | "Your session is no longer active. Goodbye." |
5353
| CONNECTING_CALL_ANNOUCEMENT | A message to play when a caller is being connected to the other party. | "We're connecting you to your agent now." |
54-
| DOMAIN | The domain where the application will be hosted. | "mysite.com" or "https://your-domain.ngrok.io" |
54+
| DOMAIN | The domain where the application will be hosted. | "mysite.com" or "your-domain.ngrok.io" (no https://) |
5555

5656

5757
Once you have your environment variables set, you can start the app with this command:
@@ -85,6 +85,10 @@ Two webhooks can be configured in the Twilio Console:
8585
- Paste your webhook (`https://[your-domain]/conversations-post-event`) into the Post-Event URL input box.
8686
- Click "save" at the bottom of the page.
8787

88+
# Authentication & Webhook Validation
89+
The app requires basic auth on request to the `/sessions` endpoint. This prevents an unauthorized person from creating sessions. To use basic auth, make sure `DOMAIN` (e.g. mysite.com, no http://), `AUTH_USERNAME`, and `AUTH_PASSWORD` are all set in your .env file, and restart the app.
90+
91+
Webhooks are automatically validated using the Twilio Webhook signature. This prevents an unauthorized request to start a phone call without your permission. For webhook validation to work, your app needs `DOMAIN` to be set along with `TWILIO_AUTH_TOKEN` in the .env file.
8892

8993
# Usage
9094
You can create a new masked-number session between multiple users by making a post request to the `/sessions` endpoint:

0 commit comments

Comments
 (0)