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

Support Twilio API key-based authentication #173

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

matt-glover
Copy link

@matt-glover matt-glover commented May 23, 2022

This PR adds support for API key auth as discussed in #124

With this change callers to APIs are able to pass api_key and api_secret options to the various REST API calls to use API key-based auth in place of the account token-based auth. This works by following the pattern of the optional account/token params already supported for sub-account auth.

I will admit I do not know Twilio's various APIs all that well or the internals of this library all that well. So my manual testing was limited to the ExTwilio.Message.create function which is the only place I happen to need this functionality.

When using API keys for auth you still need the account-level SID in your ExTwilio configuration but the account-level auth token can be omitted.

Also happy to do some other manual testing or revisit this approach, with a little guidance, if this PR seems way off the mark.

Covers existing behavior as well as the api_key/api_secret options being added
Allow callers of the REST API to pass `api_key` and `api_secret` options
to use API keys for authenticating to Twilio in lieu of the account sid
and auth token: https://www.twilio.com/docs/glossary/what-is-an-api-key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant