One twitter app to handle multiple dev environments



Reading the documentation, it allows for usage of a TDL as the callback URL. With this in mind, we use a preview branch of development as well as a live production branch. Is there a way that I could use one Twitter app with a generic callback (maybe using a TDL with a wildcard)? I would need this for authentication.

For example. I have the following sites:


I have another:

I have twitter apps for http://foo.domain and another for

I know I can create two more for the dev environment(4 apps), but is it possible to have one app to handle both (3 apps) for testing purposes? This would be a great time saver in terms of scalability.

Any help is appreciated.

Thanks, Thanh

Twitter app to handle multiple domains

You can use a single application for all of your environments. Keep a callback specified on your application record as a place-holder, then dynamically set your environment’s oauth_callback value on the oauth/request_token step.