错误验证访问令牌:会话是无效的,因为用户注销 [英] Error validating access token: The session is invalid because the user logged out

查看:2371
本文介绍了错误验证访问令牌:会话是无效的,因为用户注销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的code:

 var fbWebContext = FacebookWebContext.Current;
 if (fbWebContext.IsAuthorized())
 {
      var fb = new FacebookWebClient(fbWebContext);
      dynamic result = fb.Get("/me");

      name.Text = result.name;
 }

 dynamic result = fb.Get("/me");

抛出:

(OAuthException)错误验证访问令牌:会话是无效的,因为用户注销

(OAuthException) Error validating access token: The session is invalid because the user logged out.

我应该如何改变我的code至prevent呢?

How should I change my code to prevent this?

推荐答案

您可以要求offline_access扩展权限。这将prevent此消息,并在用户没有登录在每次

You can ask for the "offline_access" extended permission. This will prevent this message and the user does not have to log in each time.

这篇关于错误验证访问令牌:会话是无效的,因为用户注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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