Skip to content

Commit

Permalink
changed callback url to be an environment setting
Browse files Browse the repository at this point in the history
  • Loading branch information
tardate committed Aug 13, 2009
1 parent 5441bcf commit ec95520
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions README.rdoc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -131,11 +131,14 @@ and are required to complete the configuration.
Add the twitter application key and consumer secret as operating system environment variables Add the twitter application key and consumer secret as operating system environment variables
(TWOAUTH_KEY and TWOAUTH_SECRET respectively). (TWOAUTH_KEY and TWOAUTH_SECRET respectively).


Set your callback URL as operating system environment variable (TWOAUTH_CALLBACK).

Alternatively, you can edit config/environment.rb to set these directly. Alternatively, you can edit config/environment.rb to set these directly.


If you are using heroku, add the environment keys using the heroky utility (gem): If you are using heroku, add the environment keys using the heroky utility (gem):


heroku config:add TWOAUTH_KEY=8N029N81 TWOAUTH_SECRET=9s83109d3+583493190 heroku config:add TWOAUTH_KEY=8N029N81 TWOAUTH_SECRET=9s83109d3+583493190 TWOAUTH_CALLBACK=http://rails-twitter-oauth-sample.heroku.com/members/callback



== 11. Testing the application locally == 11. Testing the application locally


Expand All @@ -144,7 +147,7 @@ e.g. http://rails-twitter-oauth-sample.heroku.com/members/callback


This is the address that twitter sends users back to after the twitter authentication step. This is the address that twitter sends users back to after the twitter authentication step.


To test on a local development machine (not known on the web/in DNS) as the domain name in the callback, To test on a local development machine (not known on the web/in DNS as the domain name in the callback),
you can simply add the registered domain to your hosts file (aliasing localhost) e.g. you can simply add the registered domain to your hosts file (aliasing localhost) e.g.


127.0.0.1 rails-twitter-oauth-sample.heroku.com 127.0.0.1 rails-twitter-oauth-sample.heroku.com
Expand Down
3 changes: 2 additions & 1 deletion config/environment.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@


# Twitter OAuth settings # Twitter OAuth settings
TWOAUTH_SITE = 'http://twitter.com' TWOAUTH_SITE = 'http://twitter.com'
TWOAUTH_CALLBACK = 'http://rails-twitter-oauth-sample.heroku.com/members/callback' # Twitter OAuth callback default
TWOAUTH_CALLBACK = ENV['TWOAUTH_CALLBACK']
# Twitter OAuth Consumer key # Twitter OAuth Consumer key
TWOAUTH_KEY = ENV['TWOAUTH_KEY'] TWOAUTH_KEY = ENV['TWOAUTH_KEY']
# Twitter OAuth Consumer secret # Twitter OAuth Consumer secret
Expand Down

0 comments on commit ec95520

Please sign in to comment.