Facebook OAuthException:访问令牌无法解密 [英] Facebook OAuthException: The access token could not be decrypted

查看:384
本文介绍了Facebook OAuthException:访问令牌无法解密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在运行的应用程序,代表用户向他们的一个朋友安排了墙上的帖子。

I have a running application that does scheduled wall posts to one of their friends on behalf of the user.

应用程序运行正常,但最近安静的一些用户已经报告了没有发布的消息。

The application was running fine for quite some time but recently quiet a few of the users have reported the messages not being posted.

日志显示

OAuthException: The access token could not be decrypted. 

即使用户重新访问应用程序并重置其访问令牌,异常仍然存在。

Even if the user revisits the application and resets their Access token the exception persists.

可能是错误的根源和解决方法?

What may be the root of the error and ways to work around it?

推荐答案

如果您向Facebook API发出HTTP请求时收到以下错误消息:

If you get the following error message when making HTTP requests to the Facebook API:

{
  "error": {
       "message": "The access token could not be decrypted",
       "type": "OAuthException",
       "code": 190
  }
}

这意味着您在发送HTTP请求时发送到Facebook的访问令牌<

如果您查看 HTTP响应标头,您将看到一个这样的字段:

If you look at the HTTP response headers you will see a field like this:

WWW-Authenticate:OAuth "Facebook Platform" "invalid_token" "The access token could not be decrypted"

我收到错误因为我正在发送一个比有效的一个字符短1个字符的访问令牌。

比较持续的访问令牌与我发送的访问令之间发现了这个错误。

I was receiving the error above because I was sending an access token that was 1 character shorter than what was the valid one.
After comparing the access token persisted with the one I was sending I discovered this mistake.

您可以使用访问令牌调试器

这篇关于Facebook OAuthException:访问令牌无法解密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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