Skip to content

Instantly share code, notes, and snippets.

@lnikkila
Last active August 29, 2017 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lnikkila/58ddf1a78b00ef938ae2bc0982546850 to your computer and use it in GitHub Desktop.
Save lnikkila/58ddf1a78b00ef938ae2bc0982546850 to your computer and use it in GitHub Desktop.
Twilio signature header for Paw

Twilio signature header for Paw

Set up an HMAC-SHA1 header with the attached script as the input, and your Twilio secret as the key like this:

screen shot 2017-08-29 at 09 16 33

The script will calculate a correct signature for any request you throw at it.

// https://www.twilio.com/docs/api/security
function evaluate(context) {
const request = context.getCurrentRequest();
const body = request.getUrlEncodedBody();
return request.url +
Object.keys(body)
.map((key) => key + body[key])
.sort()
.join('');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment