wiz*_*tjh 15 ruby-on-rails oauth oauth-ruby facebook-graph-api omniauth
我读过omniauth oauth rdoc
  @consumer = OAuth::Consumer.new(key, secret, {
    :site               => "http://term.ie",
    :scheme             => :header,
    :http_method        => :post,
    :request_token_path => "/oauth/example/request_token.php",
    :access_token_path  => "/oauth/example/access_token.php",
    :authorize_path     => "/oauth/example/authorize.php"
   })
没有范围如
https://graph.facebook.com/oauth/authorize?
    client_id=...&
    redirect_uri=http://www.example.com/callback&
    scope=user_photos,user_videos,publish_stream
我该如何添加一个?我现在试图覆盖oauth ...有没有人有更好的解决方案?
wiz*_*tjh 39
把它放在初始化器中
Rails.application.config.middleware.use OmniAuth::Builder do
    provider :facebook , 'app' , 'secret' , {:scope => "manage_pages"}
end
如果您使用多个范围,则以逗号分隔:
:scope => "offline_access, manage_pages"
| 归档时间: | 
 | 
| 查看次数: | 8812 次 | 
| 最近记录: |