OAuth异常#2500 [英] OAuth Exception #2500

查看:126
本文介绍了OAuth异常#2500的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用App访问代码访问我的Facebook帐户(因为我想要不定式的访问 - 我不想要访问代码可以过期)

I am trying to access my Facebook account with an App access code (because I want indefinate access - I do not want an access code which can expire)

我已尝试使用AppId和AppSecret(这是有效的)以下代码:

I have tried the following code using AppId and AppSecret (which are valid) :

string accesstoken = m_AppId & "|" & m_AppSecret;
Facebook.FacebookClient fb = new Facebook.FacebookClient(accesstoken); 
Facebook.JsonObject fbMe = (Facebook.JsonObject)fb.Get("me"); 

,最后一行抛出一个异常,说明

and the last line throws an exception stating

OAuth异常#2500必须使用有效的访问令牌来查询有关当前用户的信息。

OAuth Exception #2500 An active access token must be used to query information about the current user."

我在这里做错什么?

推荐答案

如果您使用的是App Access令牌,路径不能由Graph API,因为应用访问令牌没有连接到特定的用户。

If you're using an App Access Token, the path me cannot be determined by the Graph API, because the App Access Token is not connected to a specific User.

解决方案是指定一个(如果使用Graph API v2.0的应用程序范围) user_id 而不是,或使用用户访问令牌。

Solution is either specify a (app-scoped if using Graph API v2.0) user_id instead of me, or use a User Access Token.

这篇关于OAuth异常#2500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆