1

FbGraph::Unauthorized: OAuthException :: (#200) The user has not Authorized the application to perform this action.My 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

スコープにアクセス許可がないことがわかりましたが、これを 1 つ追加してみてください。

それがあなたの問題を解決したかどうか教えてください

于 2013-02-01T21:49:08.163 に答える
0

Javascript SDKを追加しましたか?

于 2013-02-27T09:05:54.377 に答える