验证Facebook的访问令牌用于特定应用 [英] Verify Facebook Access Token for specific App
问题描述
我需要验证我的iPhone应用程序的用户在我的Facebook应用程序实际登录。我能够通过他们的访问令牌检索它来验证自己的用户ID:
I need to verify that users on my iPhone app are actually logged in to my Facebook app. I'm able to verify their user id by retrieving it with their Access token:
<一个href=\"https://graph.facebook.com/me?fields=id&access_token=XXXXXXXXXXXXXXX\">https://graph.facebook.com/me?fields=id&access_token=XXXXXXXXXXXXXXX
安全问题,我预见的是,他们可以给我任何有效的访问令牌,它将返回自己的用户ID。我还需要验证此令牌是我的具体应用。有没有办法在此请求返回的应用程序ID,以验证?
The security issue I foresee is that, they can send me any valid access token, and it will return their user id. I need to also validate this token is for my specific app. Is there a way to return the Application ID in this request to validate that?
推荐答案
是的。您可以查询这样的:
Yes. You can query this:
https://graph.facebook.com/app?access_token=TOKEN
这将返回有关创建的访问令牌的应用程序的名称,ID和一些统计数据。
It will return the name, id and several stats about the app that created the access token.
这篇关于验证Facebook的访问令牌用于特定应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!