Azure / Azure/azure-functions-host

Add support for API Keys authentication with Twilio Binding

Open
#8,039 5 comments 0 reactions 1 assignee Claimed by @v-bbalaiagar View on GitHub
enhancement
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

#### What problem would the feature you're requesting solve? Please describe.
Currently, the Twilio binding requires you to use the account SID and the account auth token.
This is the quickest way to authenticate, but a better way is to use Twilio API keys.
You can read more about switching to API keys with C# here: https://www.twilio.com/blog/better-twilio-authentication-csharp-twilio-api-keys

#### Describe the solution you'd like
Add a property or properties to support API keys. In Twilio's SDK the arguments to authenticate are username, password, and account SID.
To authenticate using account SID and account auth token, you'd pass in account sid to the username, and the account auth token to the password.
To authenticate using API keys, you'd pass in the API key SID to the username, and the API key secret to the password, and the account SID to accountSid.
Since the Twilio attribute for the Azure Function binding uses different property names, you probably can't follow the same naming convention without a breaking change.

I'd suggest adding 2 new properties to make this as explicit as possible without breaking changes.
- TwilioApiKeySid
- TwilioApiKeySecret

If those are filled out, you know the user wants to use API key authentication. Or even more explicitly, you could add an enum property to switch between the two types of auth.

#### Describe alternatives you've considered
I tried using the API key SID and API key secret as account SID and auth token in the binding, but that didn't work.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.