Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails rails omniauth facebook扩展权限_Ruby On Rails_Oauth_Facebook Graph Api_Oauth Ruby_Omniauth - Fatal编程技术网

Ruby on rails rails omniauth facebook扩展权限

Ruby on rails rails omniauth facebook扩展权限,ruby-on-rails,oauth,facebook-graph-api,oauth-ruby,omniauth,Ruby On Rails,Oauth,Facebook Graph Api,Oauth Ruby,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_

我读过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。。。有谁有更好的解决方案吗?

把这个放在初始化器中

Rails.application.config.middleware.use OmniAuth::Builder do
    provider :facebook , 'app' , 'secret' , {:scope => "manage_pages"}
end
如果使用多个作用域,则该作用域以逗号分隔:

:scope => "offline_access, manage_pages"

如果要使用多个:scope,请使用逗号分隔的字符串::scope=>“脱机访问,管理页面”文档进行提供程序设置。此处:此处列出的可用权限/作用域: