Skip to content

Instantly share code, notes, and snippets.

@rodrigoargumedo
Created April 1, 2015 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodrigoargumedo/531c1aae1887c3499024 to your computer and use it in GitHub Desktop.
Save rodrigoargumedo/531c1aae1887c3499024 to your computer and use it in GitHub Desktop.
This explains how to resolve the 401 Unauthorized status code and redirect your twitter app.
# Lastly, Changing in OmniAuth.rb will affect this file too.
# Change this line in order to fully work and restart the server when you save this file.
# ...viola! You now have profit to make.
Devise.setup do |config|
config.omniauth :twitter, Rails.application.secrets.twitter_consumer_key, Rails.application.secrets.twitter_consumer_secret
end
# Next, you will need to change this line of code to work this out.
# This will rertrieve the keys from config/secrets.yml
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, Rails.application.secrets.twitter_consumer_key, Rails.application.secrets.twitter_consumer_secret
end
# In order to OmniAuth-Twitter gem to work, you will need to place your keys on
# to this file.
twitter_consumer_key: [your consumer key here]
twitter_consumer_secret: [your consumer secret here]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment