Jan 25, 2010 at 5:20 PM
Edited Jan 25, 2010 at 5:25 PM
In the source for version 3.0. (currently in the DEV branch) I updated the DesktopSession object to work correctly. It now has built in support to prompt for permissions on login. Also, if you want to avoid login because you know the sessionkey
and sessionsecret of a particular user. You can just create the DesktopSession object directly and set those. you can then create an instance of the Api class and pass in the session.
You can then make any calls you need using that instance of the api class.
I have tried to use the desktop as you stated and cannot get it to work.
Can you please supply an example of how to accomplish logging in and being able to use the api to do actions?
Here's what I have tried:
List <Enums.ExtendedPermissions> extPerm = new List<Enums.ExtendedPermissions>();
FacebookSession session = new Facebook.Session.DesktopSession(apiKey, sessionSecret, sessionKey, false, extPerm);
Api api = new Api(session);
var user = api.Users.GetLoggedInUser();
The GetLoggedInUser does return my user id. My user has granted all of the above ExtendedPermissions to my application.
However, if I try to do any action on the api such as:
api.Stream.Publish("msg", null, null, String.Empty, api.Users.GetLoggedInUser());
string token = api.Auth.CreateToken();
This returns an error:
"A session key must be specified when request is signed with a session secret "