![](/img/trans.png)
[英]Rails 4 OmniAuth Facebook NoAuthorizationErrorCode
[英]rails omniauth facebook extended permission
我讀過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"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.