ASP.NET MVC3 and Facebook integration - c#

I'm just about to start a new ASP.NET project using MVC3, and since some of the requirements are about facebook integration, I need your advice on the following issues:
1- Is it achievable to connect my Membership users to thier Facebook accounts so whenever a user share/add/comment on an event on my website, I can automatically share these actions using his/her Facebook account?
2- also the ability to create Facebook events when the user create one on my site, and if he/she updates the event information, I may update them on Facebook too.
3- Can this be achieved using Facebook Connect, or this is only to authenticate users using their Facebook accounts?
4- How about using Graph API from my MVC solution, I know that there is a Facebook C# SDK on Codeplex http://facebooksdk.codeplex.com, but will it satisfy my mentioned needs or not.
Thanks in advance.

I've done something similar recently. Based on my experience:
Yes, you can connect your membership with a Facebook account, however it does not guarantee your user activity will be pushed to Facebook. (users have to log in with Facebook authentication)
Same as above. This blog post does a good job of describing it: http://amirrajan.net/Blog/asp-mvc-and-facebook-single-sign-on
No, facebook connect only takes care of authentication. For more information, check: http://thinkdiff.net/facebook/graph-api-javascript-base-facebook-connect-tutorial/
I have not tried the Facebook SDK you mentioned. However, I believe facebook Graph API already does a good job for you to and will fulfil your requirement

Related

Integrating Google Authentication in Existing Application

We have an application designed 3 years back in ASP.Net & SQL Server 2008.
We designed our own login DB design and forms authentication for the application with the help of ApplicationUser, Role, Then other transaction tables using UserId for getting the corresponding user records, history records.
So far no issues with new user registration and bringing and managing existing user records.
Now our client wants to integrate, Google Account Login for the new customer
and even the existing customer can sign in with the Google account.
We are wondering how it is possible. If you use Google Account to login, how we manage UserId mapping and other tables.
Is it possible to integrate the Google Account Login with the existing Application has designed with its own login implementation?
If yes, what are the things to be followed/considered for implementing this?
Another suggestion might be to use the nuget package SimpleAuthentication.**
Out of the box, it has an MVC controller which means all you need to do is implement the code for checking if the user exists in your system, etc. (ie. when you come back to your website from Google).
If you're on webforms (appologies) then you need to do a bit more work by creating your own form call back and then handling the return from Google.
** Disclosure: I'm one of the 2 main contributors for it.
I would use Windows Identity Foundation. It uses claims based authentication so all a user needs to access your site is a security token with a claim. You could set up a separate Security Token Service that authenticates users based on your own database and users could also retrieve tokens by logging in through Google or with any other party you configure your app to trust.
Ages ago I've created small ASP. NET MVC and if I remember correctly you can find the solution described here and here.
You may be able to find your answer in this Google+ document regarding adding Google+ authentication to existing Facebook implementations:
Adding Google+ to your Facebook Integration: Storing authorization
It talks about migrating from a single User table to a User and Identity table.
You could implement something like this in two ways:
Keep the username/password/email fields on the User table, and attach a Google authentication provider in the Identity table only when necessary.
Include username and password fields on the Identity table which are checked if the provider is "local".
You could use DotNetOpenAuth for that.
This is a "library that adds support for your site visitors to login with their OpenIDs by just dropping an ASP.NET control onto your page. It's that easy. An AJAX-style OpenID Selector control is also included for a slick, streamlined user experience."
This post explains how to work with it for Google account.

Autoshare newly added content on my website to facebook group using my facebook account

I own a facebook group and I also own an announcements website.
When an user adds a new announcement on my website, I would like the website to autoshare the announcement on my facebook group using my facebook account. The user adding the announcement on my website is not required to have a facebook account, it won't be used anyway if he has one.
If the above scenario is possible, please let me know how can I implement it.
I am not sure this is relevant, but my website is using ASP.NET with C#.
Thank you for your time.
This article is about image sharing, but im sure you can take some parts from it. http://blog.impact-works.com/2011/07/12/posting-to-facebook-wall-in-asp-netc-using-graph-apipart-5/

Granting permission with Facebook C# SDK

I have an ASP.NET MVC Site in which I would like to allow my users to grant access for my app to post to their facebook account.
My site already has log-in and auth set up, so I do not currently wish to use FB for auth/account creation.
I suppose I would like something like twitter provides, to allow users to grant access to their fb account.
Are there any samples of how to accomplish this? I am not having much luck with the docs
I'm right now building exactly the same thing!
Use the http://facebooksdk.codeplex.com/ - Facebook C# SDK.
In MVC you can add it with NUGET (search for FACEBOOK - MVC) by NTotten.
Once you added it, use the tutorial from codeplex to integrate Facebook authentication for your app.
THEN in your user database add a custom field - and link the facebook userID to the regular user ID.
The same way, e.g. stackoverflow.com has done it.
Seperate user accounts from real authentication.
YOUR site manages the user accounts, authentication is managed seperately(e.g. facebook, live-id, openid, your own id).
Makes sense?

Asp.net and Facebook authentication

I'd like to do the following:
Allow users to register in my asp.net site using their facebook credentials.
Retrieve facebook client information. Like (Name, surname, email address etc). So I can import this information into my application.
Allow users to log into my site using facebook credentials.
I've been searching and have come across these options:
Facebook.net SDK
dotnetoauth
Facebook Connect
Graph API
I'm confused as to which would be the best way to go about this.
I think that this resource offers a good tutorial on how to integrate with Facebook's user infrastructure:
http://devtacular.com/articles/bkonrad/how-to-retrieve-user-data-from-facebook-connect-in-aspnet/
There is also this code example / framework which takes you though much of the process:
http://fbconnectauth.codeplex.com/
And this walkthrough which is a little more up-to-date:
http://area72.ro/general-it/how-to-login-via-facebook-in-asp-net.html
The easiest way to implement your solution would be to use the javascript SDK for this.
You add a Facebook Login button which the user clicks on and authorizes your website giving you access to his information. This basically skips the need for registration for facebook users since the registration is the actual login process.
When the user has authorized your website (thus logged in and registered) you have access to his information which you can use to store in your users database using his faceboook id as a key. You can access the user's information sending an http request to the graph api https://graph.facebook.com/facebook_id which will return a json object with the users information.
Other then the facebook login you will want a standard login, registration form for users without facebook.
http://developers.facebook.com/docs/guides/web/

facebook offline access using c#

i am developing a notification service in c# for our web site. its windows service no ui (asp.net / winform). This service will run on certain time and post something on users wall. i use social plug-in in our web site where user can grant required permission. Based on this i have few question
1) is there any c# library or sdk available for Facebook.
2) what information i have to store in order to access facebook offline.
i hope my question is clear. thanks for any help.
Update 1: i really need help on this. thanks once again.
There is a facebook API that can be used, http://developers.facebook.com/
You can't access facebook offline? I mean, if you wanted to save current information while online and then re-access the old information while offline that is possible just by saving the webpages, but you cannot access any new information. so your not really accessing facebook..
You'll need the user to log in, and there's a permission you can request that makes the session you get permanent. You'll have to have some kind of installer or something that will have the user log in, grant that permission, and then you'll save that access token. UI-wise, look at digsby, and notice how they make you log in to facebook the first time you link your facebook account.
i found this one and its helpful
http://blog.theunical.com/facebook-integration/simple-5-steps-to-publish-on-a-facebook-wall-using-dotnet-c/

Categories