Creating a hook into my facebook app from another site - c#

new to facebook dev and I have read the basics to get a site up and running using the canvas setup. Nice and simple, I have also got the integration with users working ok (i.e. the signed_request).
I was wondering how it works with "sending/posting" data from one site that is anonymous (my own external to facebook) to the facebook site.
The flow I'm after is a user is looking at some content my site A (my own external site) and then clicks the "share on facebook" button (or whatever), which sends the user (and the data they were looking at) to the site B (my facebook app) to which they authenticate and then (and this is the part I dont get) can see that content on their personalised homepage within site B.
So is there a way to POST some kind of data to the facebook site? Or do I need to do something else here?
Thanks a lot.

You use the facebook API located here:
http://github.com/facebook/csharp-sdk
The .zip download includes the api that you can compile, as well as a sample project that uses it.
Reference: http://developers.facebook.com/blog/post/395/
EDIT
Here is some more info regarding the facebook graph api. I think you'll find everything you need in here: http://developers.facebook.com/docs/reference/api/

Related

Login to Google using windows form c#

Hi everyone I have a problem I wanna create app for generate account google drive with api google drive and I don't know how can I login with account from application not navigator C# windows form.
enter image description here
and how can i edit this credential with exist user
Try following these steps:
https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/google-logins?view=aspnetcore-3.1
I have used those steps and worked perfectly for me. You don't have a choice than to be redirected to the Google authentication page.
After entering your Google credentials, you are redirected back to the your site.
My understanding is that you are trying to use Google Drive API from a console application. Or for that matter a fully desktop application.
Take one thing in consideration, if you don't use Service account you must let the user authenticate to google and allow your application to work in his/her behalf. There is no way around this.
What you can do is after the user has already signed in, is to save the tokens and refresh them whenever necessary.
Of course OAuth may be complicated, but you use the .NET library everything will be managed for you. And you can look at a real example in the .NET Drive Quickstart

Facebook JS SDK + C# SDK Logic

I've been playing around with Facebook JavaScript SDK and Facebook SDK for .NET (Web) to try and create a simple Page tab app which does the below:
Show welcome page
If user likes the page, ask for proper extended permissions and redirect to another page reserved for fans only
Use the access token from the login to do things on the user behalf.
Anyway, my problem is with the logic of the whole thing, as the user enters the page what should I do after loading the JS SDK? It automatically shows the permissions box so that I could get the extended permissions user_likes instead of showing the welcome page.
My other issue is with the access token that is going to be used later in time. Should i store it in session state? if yes, how? What happens if i try to access it and it's expired?
I know this is a general question but please could someone guide me through the best practices to initialize and use the facebook SDK in a .NET WebForms tab app?
Thanks a lot.
(I've read through both docs on Facebook and C# SDK. Great for browsing the API but not much documentations or examples about .NET WebForms)

Retrieve hidden playlists from my own account using YouTube API without requesting password from client (.NET/C#)

I am trying to find a way to retrieve my own private playlists from my own personal YouTube account via a server side web app built in ASP.NET (C#). Based on the research that I have done, the consensus seems to be that my app needs to authenticate against my account with Oauth 2.0. I want my website to show a list of videos from a few playlists that I have set as hidden, and I want the list to show on a public page. For this reason, I obviously do not want to enter in my youtube account details every time that I browse the page.
I have looked and looked and there does not seem to be any clear way to do this. Some people have suggested going through the Oauth 2.0 authentication flow once, then use the code that it returns in the redirect URL to generate a refresh token, and use that token in your application; another suggestion I have read is to use an API service account. There does not seem to be any working example code available anywhere.
Has anyone had to do this same thing and have you been successful setting it up? Google's own API client library documentation is abysmal, especially for the .NET libraries.
If the playlists are hidden you won't be able to access them without logging in.
If the playlists are public you can always query for them through the YouTube API without having to pass your credentials.

Get Facebook UserID

Using Facebook's new Open Graph technologies launched just recently at their F8 Conference, how do I retrieve the facebook user id when a facebook user hits my open graph object? Is this even possible at all?
As per this video:
http://developers.facebook.com/blog/post/564/
I've created the object
I've also initialized the object and action on facebook:
object --> video
action --> recommend
If you go to the above .htm file and go view source, you will see the meta tags that I am using. I am referring to my pazooza:video object type, the one I created on facebook.
But the point of this is that when a facebook user hits the .htm page to view the video, then I want to record that users hit in the database.
Does fb send a signed_request or user id via the querystring or do I subscribe to the .htm file somehow and my server gets a response from facebook? I'm a lil confused any help would be appreciated.
I'm using ASP.Net MVC (Facebook C# SDK).
Never mind I found the answer, well part of it.
My architectural approach to the problem was wrong. I've spoken to one of the developers on the facebook c# sdk and some of the samples he gave made me realise how the open graph works. Or "facebooks" version of it anyway.
The MVC design pattern reigns supreme in this case. By having actions mimic the actions in your facebook open graph implementation you can now publish real-time events into the graph and have them available to new and existing users.
See this post: http://facebooksdk.codeplex.com/discussions/274238

Simple Facebook Connect Demo in ASP.NET

Does anyone have a simple and successful demo implementation of facebook connect in an asp.net application. I am developing an asp.net web application and want facebook connect to be the primary method for logging in.
I was having troubles as well, but found that this stackoverflow question got me on the right track as far as the server side stuff is concerned
However, First you have to get the facebook connect button working from here Facebook Wiki
Then detect if they are logged in or not and redirect them appropriately to a welcome page.
Detect login via Javascript
Most other actions can be done via serverside with the Facebook ToolKit. (eg get their information, friends, etc..)
The last thing I think I should mention is logging the user out, so take a look at this. Facebook Wiki: Logout
Hope this helps
As I see, all the above examples and links are really outdated. The new Facebook Graph API makes the whole process a lot easier, without the need for any other components:
http://area72.ro/general-it/how-to-login-via-facebook-in-asp-net.html
try to use the toolkit called Facebook Developer Toolkit
you have in Steve Blog a post about it, and you even download he's Starter Kit so you can view all the code :)
Hope it helps
I know you asked for ASP.NET resources. The Facebook Connect page provides some good information as well as the source to a sample implementation using PHP. Hopefully you can pull some good information from the PHP code.
http://developers.facebook.com/connect.php Check out the links on the right side.
The provided demo can be accessed here... http://www.somethingtoputhere.com/therunaround/

Categories