twilio / twilio-ruby

A Ruby gem for communicating with the Twilio API and generating TwiML
MIT License
1.35k stars 462 forks source link

Authenticate requests against multiple Tokens #660

Closed cristofer closed 1 year ago

cristofer commented 1 year ago

Issue Summary

We are currently in the phase of evaluating the migration of some Twilio numbers from US to Ireland, and we would like to do it in incremental steps, for that we need to find a way to use Rack::TwilioWebhookAuthentication with more than one Auth Token, as each region has its own ones. As a proof of concept I created a fork and I am using these changes.

I would like to check with you guys if this could be a feasible approach to achieve that. We also want to have the possibility to authenticate with either the Primary or the Secondary token, so this allows us to do that, plus tokens from other regions.

If you happen to have a better approach, would be very much appreciate to know how to achieve that.

Technical details: