我实现了一个配置了 OmniAuth/Twitter 和 OmniAuth/Facebook 的项目。在开发模式有任何问题。
但是当我尝试使用heroku时。它拒绝工作。
use Rack::Session::Cookie
use OmniAuth::Builder do
provider :twitter, ENV['TWITTER_APP_ID'], ENV['TWITTER_SECRET']
provider :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_SECRET'], :scope => 'email'
end
Heroku 日志
012-11-02T03:28:47+00:00 app[web.1]: E, [2012-11-02T03:28:47.339453 #58] ERROR -- omniauth: (twitter) Authentication failure! invalid_credentials: OAuth::Unauthorized, 401 Unauthorized
2012-11-02T03:28:47+00:00 heroku[router]: GET p####.herokuapp.com/auth/twitter/callback?oauth_token=r6l3GpwmxH38W8Q9WltcWs9PqyyGxxiGAUqXGFhmKs&oauth_verifier=O9HD6jLaEL1aRUcORIebGEZIQHbqtcgB012q5aZlCE dyno=web.1 queue=0 wait=0ms service=368ms status=302 bytes=9
2012-11-02T03:28:47+00:00 app[web.1]: 92.160.179.137 - - [02/Nov/2012 03:28:47] "GET /auth/failure?message=invalid_credentials&origin=https%3A%2F%2F p####.herokuapp.com%2Flogin&strategy=twitter HTTP/1.1" 200 3160 0.0033
2012-11-02T03:28:47+00:00 heroku[router]: GET p####.herokuapp.com/auth/failure?message=invalid_credentials&origin=https%3A%2F%2F p####.herokuapp.com%2Flogin&strategy=twitter dyno=web.1 queue=0 wait=0ms service=8ms status=200 bytes=3160
谢谢