I've created Facebook page. I have no application secret and no access token.
I want to post to this page from my .NET desktop application. How can I do it? Can anyone help please, where can I get access token for this?
Should I create a new Facebook Application? If yes, how can I grant permissions to this application to post on page's wall?
UPD1: I have no website. I need to post company's news from .NET desktop application to company's Facebook page. All I have is Login/Password for Facebook Page Account.
UPD2: I've created Facebook Application. With AppID/SecretKey. I can get access token. But... How can I grant permissions to post to page's wall?
(OAuthException) (#200) The user hasn't authorized the application to perform this action
You can use https://www.nuget.org/packages/Microsoft.Owin.Security.Facebook/ to obtain users login and permission and https://www.nuget.org/packages/Facebook.Client/ to post to feeds.
Below example is for ASP.NET MVC 5:
On the callback you get user access token:
Which then you can use to post to user's feed or page
I posted full example over here: https://klaatuveratanecto.com/facebook-wall-feed-posting-asp-net-mvc/
You will get information on how to create a facebook app or link your website to facebook on https://developers.facebook.com/?ref=pf.
You will be able to download facebook sdk at http://facebooksdk.codeplex.com/. There are some good example given in the document section of the site.
I have created a video tutorial showing how to do this at this location:
http://www.markhagan.me/Samples/Grant-Access-And-Post-As-Facebook-User-ASPNet
You will notice that, in my example, I am asking for both "publish_stream" and "manage_pages". This let's you also post on pages of which that users is an admin. Here is the full code:
You need to grant the permission "publish_stream".
You need to ask the user for the publish_stream permission. In order to do this you need to add publish_stream to the scope in the oAuth request you send to Facebook. The easiest way to do all of this is to use the facebooksdk for .net which you can grab from codeplex. There are some examples there of how to do this with a desktop app.
Once you ask for that permission and the user grants it you will receive an access token which you can use to post to your page's wall. If you need to store this permission you can store the access token although you might need to ask for offline_access permission in your scope in order to have an access token that doesn't expire.