Facebook OAuth 重定向显示 FB 图像/链接而不是授权页面
我有一个 Perl CGI 脚本执行 Facebook 授权流程,如 http://developers.facebook.com/ 中所述文档/身份验证/。当我在浏览器中访问 Facebook 应用程序页面时,我的脚本接收来自 Facebook 的初始查询,对signed_request 进行身份验证,然后将重定向发送到以下网址:
https://graph.facebook.com/oauth/authorize? client_id= NNN&scope=[...]&display=page&redirect_uri=http%3A%2F%2Fmydomain.com%3A8080%2Fperl%2Fdev%2Ffb.pl%3Fcallback%3D1
redirect_uri 是我定义为我的 Web 的内容站点在应用程序配置中,并且它被很好地接受。但浏览器随后显示的是一个大的 Facebook 徽标图像及其下方的链接,这两个链接均指向:
http ://www.facebook.com/connect/uiserver.php?display=page&next=https%3A% 2F%2Fgraph.facebook.com%2Foauth%2Fauthorize_success%3Fredirect_uri%3D[...]
当我点击它时,我得到了我想要的,“请求权限”页面要求用户授权该应用程序。一切从那里开始正常进行。
那么为什么我会看到初始 FB 徽标页面而不是直接进入授权页面呢?
I have a perl CGI script doing the Facebook authorization flow as described at http://developers.facebook.com/docs/authentication/. When I go to my Facebook app page in a browser my script receives the initial query from Facebook, authenticates the signed_request, and then sends a redirect to the following url:
https://graph.facebook.com/oauth/authorize?client_id=NNN&scope=[...]&display=page&redirect_uri=http%3A%2F%2Fmydomain.com%3A8080%2Fperl%2Fdev%2Ffb.pl%3Fcallback%3D1
The redirect_uri is what I have defined as my Web Site in the app config, and it gets accepted just fine. But what the browser then shows is a big Facebook logo image and a link below it, both of which go to:
http://www.facebook.com/connect/uiserver.php?display=page&next=https%3A%2F%2Fgraph.facebook.com%2Foauth%2Fauthorize_success%3Fredirect_uri%3D[...]
When I click on that I get what I want, the "Request for Permission" page asking the user to authorize the app. Everything proceeds normally from there.
So why am I getting that initial FB logo page instead of going directly to the authorization page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有人在 Facebook 论坛 (http://forum.developers. facebook.net/viewtopic.php?pid=290957#p290957),具有讽刺意味的是,这里引用了另一个问题。您只需要使用 JavaScript 进行客户端重定向,因此 CGI 脚本的输出应如下所示:
Someone answered this over in the Facebook forum (http://forum.developers.facebook.net/viewtopic.php?pid=290957#p290957), ironically with a reference back to another question here. You just need to do a client-side redirect using javascript, so the output of your CGI script should look like: