Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for API Keys authentication with Twilio Binding #593

Closed
v-bbalaiagar opened this issue Jan 11, 2022 · 2 comments
Closed

Add support for API Keys authentication with Twilio Binding #593

v-bbalaiagar opened this issue Jan 11, 2022 · 2 comments
Labels
status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library

Comments

@v-bbalaiagar
Copy link

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.

  1. TwilioApiKeySid

  2. 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.

@JenniferMah JenniferMah added status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library labels Jan 12, 2022
@JenniferMah
Copy link
Contributor

Hi @v-bbalaiagar! Please checkout issue #531. You can use the following code to authenticate with your Twilio API key:

TwilioClient.Init(keySID, keySecret, accountSID);

Plus ones on issue #531 will help move it up in the backlog.

@Swimburger
Copy link
Contributor

I'm sorry but there seems to be some confusion going on here. The OP copy/pasted the GitHub issue I reported at the Azure Functions repository.
The request does not make sense inside of the Twilio C# SDK repository.
I am asking for Azure Functions to add support for Twilio API key authentication, in addition to their already existing account/auth token authentication.
AFAIK, the Twilio Binding for Azure Functions is owned by the Azure Functions team, not by Twilio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library
Projects
None yet
Development

No branches or pull requests

3 participants