我正在使用ASP.NET MVC3和Facebook C#SDK 4.2.1
如果我用CanvasAuthorize
装饰一个至少有一个perrmission的控制器或动作,一切都很好。但是,如果我没有传递任何权限或传递空权限字符串,我会收到以下错误:
[FacebookOAuthException: (OAuthException) Error validating access token.]
Facebook.FacebookApp.MakeRequest(HttpMethod httpMethod, Uri requestUrl, Byte[] postData, String contentType, Type resultType, Boolean restApi) in d:\Projects\facebooksdk\Source\Facebook\FacebookApp.cs:800
Facebook.<>c__DisplayClass1.<OAuthRequest>b__0() in d:\Projects\facebooksdk\Source\Facebook\FacebookApp.cs:456
Facebook.FacebookApp.WithMirrorRetry(Func`1 body) in d:\Projects\facebooksdk\Source\Facebook\FacebookApp.cs:591
Facebook.FacebookApp.OAuthRequest(Uri uri, IDictionary`2 parameters, HttpMethod httpMethod, Type resultType, Boolean restApi) in d:\Projects\facebooksdk\Source\Facebook\FacebookApp.cs:456
Facebook.FacebookApp.Graph(String path, IDictionary`2 parameters, HttpMethod httpMethod, Type resultType) in d:\Projects\facebooksdk\Source\Facebook\FacebookApp.cs:440
Facebook.FacebookAppBase.Api(String path, IDictionary`2 parameters, Type resultType, HttpMethod httpMethod) in d:\Projects\facebooksdk\Source\Facebook\FacebookAppBase.cs:431
Facebook.FacebookAppBase.Get(String path) in d:\Projects\facebooksdk\Source\Facebook\FacebookAppBase.cs:465
Web.Areas.Facebook.Controllers.HomeController.Index(Int32 page, String term) in C:\Users\richard\Documents\My Dropbox\Projects\...\...\Web\Areas\Facebook\Controllers\HomeController.cs:13
lambda_method(Closure , ControllerBase , Object[] ) +164
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +264
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +129
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +796154
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +796154
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +314
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +798800
System.Web.Mvc.Controller.ExecuteCore() +159
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +335
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +62
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +20
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +54
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +453
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +371
这是我做错了什么,还是SDK的问题?
富
答案 0 :(得分:0)
我遇到了与此类似的问题,所以不确定它是否与您的问题有关,但我的是fbs_APPID cookie不再有效但仍尝试从中拉出access_token。