如何设置 RPX 小部件和 facebook 应用程序以便能够通过 rpx_now 进行身份验证?
使用 rpx_now
gem 的示例应用程序 ( http://github.com/grosser/rpx_now_example ) 在 localhost:3000 上,我已通过 Google 帐户、myOpenID、Yahoo 成功登录,但无法通过 Facebook 登录。
在 RPX 应用程序/小部件设置中,我设置了 facebook 应用程序密钥和秘密。在我的 Facebook 应用程序设置中,连接 URL 为 myappname.rpxnow.com
。但是当我尝试连接时,我什至看不到 facebook 登录页面,只看到一些重定向,然后我回到本地主机,但出现以下异常 http://gist.github.com/386520 。
然而,在我成功连接 oauth2 gem 之前,没有获取用户数据 - 仅进行身份验证。那次我只设置了 key/secret 和 localhost
作为我的连接 URL。目前,我什至不要求电子邮件等,但仍然存在同样的问题。
是否会因为 rpx_now
无法从 facebook 获取请求的用户数据而发生这种情况?或者是 facebook key/secret 的问题?我可能需要提供我的 Facebook 应用程序的更多设置吗?
RPXNow::ApiError in UsersController#create
Got error: Invalid parameter: token (code: 1), HTTP status: 200
RAILS_ROOT: /home/Andrei/rpx_now_example
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/rpx_now-0.6.20/lib/rpx_now/api.rb:71:in `parse_response'
/usr/lib/ruby/gems/1.8/gems/rpx_now-0.6.20/lib/rpx_now/api.rb:21:in `call'
/usr/lib/ruby/gems/1.8/gems/rpx_now-0.6.20/lib/rpx_now.rb:23:in `user_data'
/home/Andrei/rpx_now_example/app/controllers/users_controller.rb:16:in `create'
Request
Parameters:
None
Show session dump
Response
Headers:
{"Content-Type"=>"",
"Cache-Control"=>"no-cache"}
Using the sample app for rpx_now
gem ( http://github.com/grosser/rpx_now_example) on localhost:3000, I have successfully logged in via Google Accounts, myOpenID, Yahoo, but cannot make it via Facebook.
In the RPX app/widget settings I have set my facebook-app key and secret. In my facebook app settings, the Connect URL is myappname.rpxnow.com
. But when I try to connect, then I don't even see a facebook login page, just a number of redirects and I am back to my localhost with the following exception http://gist.github.com/386520 .
Before I was successfully connecting with oauth2
gem, however, without fetching user data - only authentication. That time I set only key/secret and localhost
as my Connect URL. Currently, I don't even ask for email etc., but still the same problem.
Can it happen because rpx_now
cannot get requested user data from facebook? Or it is a problem of facebook key/secret? May be I need to provide more settings of my facebook app?
RPXNow::ApiError in UsersController#create
Got error: Invalid parameter: token (code: 1), HTTP status: 200
RAILS_ROOT: /home/Andrei/rpx_now_example
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/rpx_now-0.6.20/lib/rpx_now/api.rb:71:in `parse_response'
/usr/lib/ruby/gems/1.8/gems/rpx_now-0.6.20/lib/rpx_now/api.rb:21:in `call'
/usr/lib/ruby/gems/1.8/gems/rpx_now-0.6.20/lib/rpx_now.rb:23:in `user_data'
/home/Andrei/rpx_now_example/app/controllers/users_controller.rb:16:in `create'
Request
Parameters:
None
Show session dump
Response
Headers:
{"Content-Type"=>"",
"Cache-Control"=>"no-cache"}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了解决这个问题,需要进入Facebook应用程序,单击“编辑设置”,选择左栏中的“迁移”并将“新数据权限”切换为禁用。此参数旁边有一条注释:启用新数据权限和新权限对话框。 (迁移结束日期:2010 年 6 月 1 日)
因此,我想需要更新
rpx_now
gem 才能使用新界面。In order to solve it, one needs to go to Facebook application, click "Edit Settings", select "Migrations" on the left column and toggle "New Data Permissions" to disabled. There is a comment next to this parameter: Enable the new data permissions and the new permissions dialog. (Migration ends on: June 1, 2010)
So, I guess one needs to update
rpx_now
gem to work with the new interface.