Support Twilio API Keys

Twilio recommends using API keys as a more secure alternative to using account credentials.

This requires a small change to the Twilio API call to include the apiKey in addition to the accountSid (and replacing the accountSid auth_token with the apiSecret).

See this Twilio blog post for a fairly succinct explanation.

And the Twilio API key login documentation.

I believe this is the primary file that needs to be updated.
https://github.com/home-assistant/core/blob/3ecc914f290365b24724321221268b225f08c495/homeassistant/components/twilio/__init__.py

I thought about submitting this as an issue at github, but decided it is probably a feature request. I am happy to create the github issue if that is more appropriate.

Thanks

If you know how you should submit a PR for the fix instead.

Hi Finity,

I don’t have a dev environment set up for making and testing changes.

If no one who maintains this integration want to make the fix, I may try to find time to get into it.

Fwiw, I think changing account_sid to username might be sufficient, but that would have to be done in a way that does not break things for existing configurations.

Cheers

1 Like