开发者

How to use CanvasAuthorizer

开发者 https://www.devze.com 2023-03-26 20:26 出处:网络
I download the latest version and successfully tested the Mvc3Web sample. I tried to extend it to get email and friends but the CanvasAuthorizer is failing.

I download the latest version and successfully tested the Mvc3Web sample. I tried to extend it to get email and friends but the CanvasAuthorizer is failing. The code below开发者_如何学Python is not working: CanvasAuthorizer _authorizer = new CanvasAuthorizer {Permissions = {"publish_stream,offline_access"};

throwing an exception complaining about appId being empty. Any idea how to acheive this? It's pitty that the samples are missing the permissions request functionalities.


change the code to use permissions as array.

CanvasAuthorizer _authorizer = new CanvasAuthorizer {Permissions = new[] {"publish_stream", "offline_access"}};

Update: Also make sure to have proper app settings in web.config for the application. or set it programatically (during application_beginrequest)

FacebookApplication.SetApplication(new DefaultFacebookApplication{ AppId = "...", AppSecret = "..." });
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号