OmniAuth facebook与Ruby上的Devise在rails上没有通过app_id

时间:2015-06-23 12:01:42

标签: ruby-on-rails ruby-on-rails-4 devise omniauth omniauth-facebook

我正在使用Devise设置rails应用程序(4.1.10)。我正在使用此设计指南添加OmniAuth Facebook集成:https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview

我想我已经设置了我应该做的所有事情(我知道我应该把app_id和秘密放到ENV变量中 - 一旦这个工作我将移动到这里)但是当我点击我的登录到facebook链接时我得到一个错误:

https://www.facebook.com/dialog/oauth?client_id=&display=popup&redirect_uri=http%3A%2F%2Fwww.clazzoo.com%2Fusers%2Fauth%2Ffacebook%2Fcallback&response_type=code&scope=email%2Cuser_birthday%2Cread_stream&state=b43008b5d8e714e91ac37b4410f7758655efecbca7bfe98e

Warning
The parameter app_id is required

配置在这里:

    # Use this hook to configure devise mailer, warden hooks and so forth.
    # Many of these configuration options can be set straight in your model.
    Devise.setup do |config|
     ...
    ...

    config.omniauth :facebook, "1602932433319776", "7221cf917c6e55ba68c8e81145994481",
      :scope => 'email,user_birthday,read_stream',
      :display => 'popup'

    config.omniauth :stripe_connect,
    Settings.stripeConnectClientID,
    Settings.stripeSecretKey,
    :scope => 'read_write',
    :stripe_landing => 'register'
  end

User模型具有omniauthable set:

class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable, :confirmable,
         :omniauthable, :omniauth_providers => [:facebook]

那么为什么当我点击我的链接时会错过相应的ID?

1 个答案:

答案 0 :(得分:1)

我不确定是什么被打破了 - 结果重新将我的代码重新发送到heroku并进行了一次heroku重启修复了它。简单;)