从页面标签验证用户 [英] Authenticate a user from a page tab
问题描述
我试图让一个Facebook页面标签,人们可以从一堆文件中嵌入投票选出他们最喜欢的视频或音乐曲目。我需要从每个用户一个唯一的ID,以确保他们只能投票一次。该signed_request只包含用户的ID,如果他们认可我的应用程序。
I'm trying to make a Facebook page tab where people can vote for their favorite video or music track from a bunch of embedded files. I need to get a unique ID from each user to make sure that they can only vote once. The signed_request only contains the user's id if they have authorized my app.
我试图让用户授权使用FB.login()JavaScript API第我的应用程序,但我得到的错误:
I have tried to have users authorize my app using the FB.login() javascript api, but I get the error:
与混音//返修投票时发生错误。请稍后再试
API错误code:191
API Error Code: 191
API错误描述:指定的URL不属于应用程序
API Error Description: The specified URL is not owned by the application
错误消息:无效REDIRECT_URI:给定的URL不是由应用程序配置允许
Error Message: Invalid redirect_uri: Given URL is not permitted by the application configuration.
据我所知,我没有设置任何重定向URL。我是否需要设置这个地方,还是这是不正确的方法来获取用户验证我的网页标签?
As far as I know, I have not set any redirect URL. Do I need to set this somewhere, or is this the not right approach to get a user to authenticate my page tab?
推荐答案
所以我设法得到这个由应用程序设置滴答作响的应用程序在Facebook上,并设置画布网址工作code>和
安全帆布网址
s到相同的页面标签URL当量。
So I managed to get this to work by ticking "App on Facebook" in the app settings, and setting the Canvas URL
and Secure Canvas URL
s to be the same as the Page Tab URL equivalents.
这工作,即使这不是一个完整的应用程序,它只是一个页标签,除非它是在一个容器页面将不能作为一个应用程序。
This worked even though this isn't a full app, it's only a page tab, and it won't function as an app unless it's in a container page.
我猜这是Facebook的一个bug - 用户界面意味着你可以有一个页面标签唯一的应用程序。该文件没有说你不能,我不能想到一个很好的技术原因它不condsider页选项卡网址为有效网址。
I'm guessing this is a bug in Facebook - the UI implies that you can have a page tab only app. The documentation doesn't say you can't, and I can't think of a good technical reason for it not to condsider a page tab URL as a valid URL.
感谢 @胡里奥 - 桑托斯在的Facebook - 错误消息:REDIRECT_URI不是由应用时,这似乎是在一个稍微不同的上下文相同的问题资
Thanks to @julio-santos for pointing me at Facebook - Error Message: redirect_uri is not owned by the application, which seems to be the same problem in a slightly different context.
这篇关于从页面标签验证用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!