Note that there are some explanatory texts on larger screens.

plurals
  1. POMigrating from old (v3.0) Facebook .Net SDK to the latest (v5.0)
    primarykey
    data
    text
    <p>originally i was using a .net sdk for facebook found here:</p> <p><a href="http://facebooktoolkit.codeplex.com/" rel="nofollow">http://facebooktoolkit.codeplex.com/</a></p> <p>but now, i am trying to migrate over to the latest version which is hosted below, and implements many of the new facebook features that have recently :</p> <p><a href="http://facebooksdk.codeplex.com/" rel="nofollow">http://facebooksdk.codeplex.com/</a></p> <p>Even though I've built a few facebook canvas applications and even integrated our company website to use facebook connect, I still get a bit confused with the nuances and details about facebook authentication/authorization changes. For example, how would I port the below .NET serverside code that I used from our old (v3.0) .NET SDK integration with Facebook over to the new v5.0 .NET SDK?</p> <pre><code> string perm = "publish_stream"; //or any permission you want to check FBConnectAuthentication auth = new FBConnectAuthentication(Settings.FBConnectAPIKey, Settings.FBConnectAPISecret); FBConnectSession fbSession = auth.GetSession(); string userId = fbSession.UserID; var session = new Facebook.Session.ConnectSession(Settings.FBConnectAPIKey, Settings.FBConnectAPISecret); var api = new Facebook.Rest.Api(session); var usr = SessionInfo.CurrentUserOrUserAccountWithLastEmailAddressEntered; Facebook.Schema.Enums.ExtendedPermissions perm = (Facebook.Schema.Enums.ExtendedPermissions)Enum.Parse(typeof(Facebook.Schema.Enums.ExtendedPermissions), permission); hasPermission = api.Users.HasAppPermission(perm); </code></pre> <p>since the above code is being executed from our server using the REST apis, when porting over to the new sdk should i not worry about using an OAuth access_token? </p> <p>on the client side, when an end user views a page of my website things seem to work fine when i do the below javascript calls:</p> <pre><code>FB.Connect.showPermissionDialog('publish_stream, email, user_checkins', publishToWallPermissionGranted); function publishToWallPermissionGranted() { FB.Connect.streamPublish('some share message', null, null, null, false, null); } </code></pre> <p>using the client side code above, i am not storing an access_token or doing anything like that, but how come i am able to successfully authenticate, authorize and publish to a user's stream?</p> <p>i would really appreciate anyone that can also give me a more detailed explanation when i should use Oauth to get an access token (ie. if a user is using my canvas application) or when i should simply use my appId to initialize the javascript FB object (ie. FB.init()) when making client side api calls or when i should get an application access token. </p> <p>thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload