Writing Facebook apps in C# - c#

I am a C# developer and fancy the idea of writing a C# app or two to integrate with the Facebook API. I read from this page:
http://wiki.developers.facebook.com/index.php/User:C_Sharp
that there's this Microsoft SDK for Facebook Platform that has binary assemblies that I can use to write my C# app. As a start, I want to try out the example mentioned on the above-mentioned page -- one that gets me a friend list.
The problem is: I am completely new to this Facebook development thing and I see I am going to need, at the very least, an API Key and some Facebook service Secret key or some such, to begin writing some code.
Do I also need a developer account? Where do I get all these things from?

Use the Facebook Developers application. With this application you can register a new application with Facebook and manage all your applications as well. Each registered application has associated API key and application secret.
To create a new application click on the + Set Up New Application button.
Note that if anyone gets a hold of the API key and the application secret, they can impersonate your application, so keep those safe.

Related

How do I create a Firebase user from C#?

I am using Firebase, and I want to be able to create a user, get his ID, and then create his profile data.
I can do this using Google.Cloud.Firestore, just the way we do it in Android. However, I want to do this from a C# web application.
I have not been able to find anything that creates an auth user that is callable from C#. How can I do this?
There's this FirebaseUI Widget in javascript which really gives a lot's of auth options out of the box (Google, phone, email/password, etc.), but I need to use my own interface (i.e., the interface required by my client).
There is no SDK for accessing Firebase Authentication from C#/ASP.NET web application.
But there is a REST API for Firebase Authentication that you can call from any platform that can make HTTPS calls, and which has a method to create a user account.
A quick search also lead me to this third-party library by Step Up Labs, but I have no experience with it.

Accessing browser cookies from .Net WinForms

I have an internal angular application which connects to a Web API for all business logic and data. Company users can log in, and there is a cookie which stores an identifier. The API is also aware of the identifier, and can associate it with the user/computer. Now, I have some usb proxcard readers which have an SDK which can be used in .Net desktop applications for reading proxcards. I want to have a .Net WinForms app running which reads the proxcard, and then can send the proxcard value to the API along with the identifier stored in the browser cookie (because the API needs to know the user/computer). Is there a way I can read the browser cookies from my WinForms app in any of the top web browsers? Or an alternative way I can get the identifier between the WinForms app and the browser app? Thanks

Creating my own external authentication service

I'm trying to find a full tutorial on creating your own extent authentication service. Similar to the ones you see that say "Login with Google" or Facebook or Twitter... How do I create my own version of those? Including allowing creation of "apps", creating their app key and secret.
Maybe I'm searching for the wrong terms when looking, I'm not sure.
Ive have a need for a central login service where applications will be able to login a user and receive their information if they have sufficient permissions.
I'm using c# and web api 2 if this helps.
Thanks
IdentityServer (3 or 4 depending on your .Net preference) would be a good place to start. It is an open source project that supports the OAuth2 / Open ID protocols and is very well documented to show you where to plug in your app into the pipeline. https://identityserver4.readthedocs.io/en/release/index.html

How to authorize my app with Facebook

I know I have seen apps that log me in using Facebook but never present me with an authorization screen. I can not, for the life of me, figure out how to do this with Windows Phone 7. The best I have been able to get is using the Facebook for C# SDK to get the authorization screen in a WebView. This looks hideous and the page does not even appear to be mobile ready.
I have searched high and low for an answer and have found nothing. Wondering if anyone can point me in the right direction to getting this to work?
Yes, I also saw this kind of apps (e.g. Spotify prompts you to enter your Facebook account credentials rather than using the normal authorization flow). My best guess is that they either some kind of premium partners and have access to some private APIs or they use custom authorization flows (e.g. when you authorize an app on a website, the system saves authorization key in the database. The same app id/secret is then used in Windows Phone app and all you need to do is to type in your email/username in order for the system to locate authorization key that was saved earlier).
I also don't like the approach of displaying Facebook login/auth using WebBrowser control (mostly because of UI inconsistency) but I'd say that this is still the way to go in most cases (because this is the official and recommended way of authorizing the app and all other approaches seem hacky for me and also have their disadvantages).
You will want to be using the "server-side authentication" approach. The following document describes how it works: Server-side authentication (read also OAuth Dialog documentation for how to configure the authentication dialog). You can change the way the UI looks by passing a display parameter (either to touch or wap).
Please note that display=touch is currently broken in Windows Phone - Facebook always falls back to wap which is deprecated and will be removed as per July 2012 update (corresponding case: Facebook API can't be used with Windows Phone apps). It's also among known issues on Facebook C# SDK project page: Facebook C# SDK - Known issues.
Hope this clarifies things a bit.

Struggling to understand the structure of the Facebook API

Ultimately I want to create a desktop app that allows users to update their own status, view status' of their friends, update pics etc. - basically a lot of the functionality the facebook website provides. Through looking through some tutorials and sample projects it seems that an app must be created for the facebook account. Now is this the facebook account of the developer (i.e. mine) - which will provide an API key that will allow any other user to log in?? Does every desktop project need to authenticate the user through a facebook dialog window to take the users' credentials?? Where does OAuth fit into this?? If anyone can shed any light as to the structure of the facebook api and the ways in which I can grant this functionality from say a WPF C# app for example I would really appreciate it.
EDIT: Before complaints of a potentially huge question or too 'vague', my question is specific to the integration/use of the facebook API in desktop applications - not how to then retrieve status feeds etc. I'll work that out myself.
Per Facebook documentation, all desktop apps will need to implement some form of web browser integration, whether embedded within the desktop app or controlled.
See: http://developers.facebook.com/docs/authentication/
Desktop Apps
Our OAuth 2.0 implementation does not include explicit desktop app
support. However, if your desktop app can embed a web browser (most
desktop frameworks such as .NET, AIR and Cocoa support embedding
browsers), you can use the client-side flow with one modification: a
specific redirect_uri. Rather than requiring desktop apps to host a
web server and populate the Site URL in the Developer App, we provide
a specific URL you can use with desktop apps:
https://www.facebook.com/connect/login_success.html.
Don't worry it took me two solid days of trial and error and re-re-reading of the documentation on authentication to finally "get" it.

Categories

Resources