1

我收到错误 FbGraph::Unauthorized: OAuthException :: (#200) 用户尚未授权应用程序执行此操作。我的 omniauth.rb 如下所示:

Rails.application.config.middleware.use OmniAuth::Builder do
 provider :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_SECRET'], {:scope => "offline_access, publish_stream, user_photos, publish_checkins, photo_upload"}
end

我的控制器包含:

me = FbGraph::User.me(ACCESS_TOKEN)
me.feed!(
:message => 'Updating via FbGraph',
:picture => 'https://graph.facebook.com/matake/picture',
:link => 'https://github.com/nov/fb_graph',
:name => 'FbGraph',
:description => 'A Ruby wrapper for Facebook Graph API'
)

我得到了这个错误:

FbGraph::Unauthorized: OAuthException :: (#200) The user hasn't authorized the application to perform this action
    from /home/usr/.rvm/gems/ruby-1.9.3-p194@usr/gems/fb_graph-2.5.5/lib/fb_graph/exception.rb:55:in `handle_httpclient_error'
    from /home/usr/.rvm/gems/ruby-1.9.3-p194@usr/gems/fb_graph-2.5.5/lib/fb_graph/node.rb:147:in `handle_response'
    from /home/usr/.rvm/gems/ruby-1.9.3-p194@usr/gems/fb_graph-2.5.5/lib/fb_graph/node.rb:55:in `post'
    from /home/usr/.rvm/gems/ruby-1.9.3-p194@usr/gems/fb_graph-2.5.5/lib/fb_graph/connections/feed.rb:15:in `feed!'
    from (irb):4
    from /home/usr/.rvm/gems/ruby-1.9.3-p194@usr/gems/railties-3.2.3/lib/rails/commands/console.rb:47:in `start'
    from /home/usr/.rvm/gems/ruby-1.9.3-p194@usr/gems/railties-3.2.3/lib/rails/commands/console.rb:8:in `start'
    from /home/usr/.rvm/gems/ruby-1.9.3-p194@usr/gems/railties-3.2.3/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

请解决我的问题。我正在使用有效的 access_token 谢谢

4

2 回答 2

1

对于我看到你在你的范围内缺少权限尝试添加这个publish_actions,

让我知道这是否解决了您的问题

于 2013-02-01T21:49:08.163 回答
0

你添加了Javascript SDK吗?

于 2013-02-27T09:05:54.377 回答