我正在尝试将用户重定向到请求访问用户信息的权限的 URL。
我有一个表单的视图,其操作如下:
class AuthController < ApplicationController
def auth
@oauth = Koala::Facebook::OAuth.new("*id*", "*secret*", 'http://localhost:3000/auth/auth2')
address = @oauth.url_for_oauth_code(:permissions => "publish_stream")
puts "address #{address}"
redirect_to address
return
end
def auth2
end
end
在 上stdout
,地址显示为:Redirected to https://graph.facebook.com/oauth/authorize?client_id=*id*&redirect_uri=http://localhost:3000/auth/auth2&scope=publish_stream
如果我在浏览器中独立输入此 URL(而不是通过我的应用程序),我会被带到应用程序请求权限的正确页面。但是,通过我的应用程序,我被带到一个显示 Facebook 徽标的页面,而不是请求权限的页面。
我希望看到权限页面,然后一旦用户允许,请求就会转发到我的 redirect_uri。