Wednesday, 16 June 2010

New version of FBConnectAuth released: 1.0

One year on, I've just released a minor enhancement to the tiny open source project I created called FBConnectAuth - Facebook Connect Authentication for ASP.NET.

This release contains two enhancements:
  • It supports Facebook's new Graph API Javscript SDK (but remains backwards compatible)
  • It works in partially trusted environments
It is specifically targeted at .NET 2.0 (as was the previous release) for the benefit of those who don't have control over their production environment.

Interestingly, I noticed that the new Graph API requires the use of the Facebook Application's "Application ID", rather than "API Key". This means that an example of using FBConnectAuth looks with the Graph API like this:


//Note this is the "app id", not "api Key"
FBConnectAuthentication auth = new FBConnectAuthentication(appId,appSecret);
if (auth.Validate() != ValidationState.Valid)
{
// The request does not contain the details
// of a valid Facebook connect session.
// You'll probably want to throw an error here.
}
else
{
FBConnectSession fbSession = auth.GetSession();

string userId = fbSession.UserID;
string sessionKey = fbSession.SessionKey;

//This is the Graph API access token
//(available only when using the Graph API)
string accessToken = fbSession.AccessToken;

// The above values can now be used to communicate
// with Facebook on behalf of your user,
// perhaps using the Facebook Developer Toolkit

// The expiry time and session secret is also available.
}


If you are interested, go take a look.

5 comments:

  1. Try not to become a man of success, but rather try to become a man of value. See the link below for more info.


    #rather
    www.ufgop.org

    ReplyDelete
  2. Sometimes life is so unfair and has a lot of challenges to take but it doesn't
    mean it is already the end of the world. We struggle and experienced those things
    for us to become strong, aware, and responsible of our actions. Thanks for
    sharing such a wonderful story.I hope that you can inspire more people.
    You can also visit my site and have a good day!

    n8fan.net

    www.n8fan.net

    ReplyDelete
  3. Just saw Pitch Perfect 3 trailer. Looks like its going to be another year of fun ride. Incredibly excited to see the Bella ladies returning on screen. Wish there was something going on between Beca and Chloe in this one. Give something for use queer ladies too, will you Trish ;)
    To know about Pitch Perfect 3 Rumors just take a look and you get all the information you need.

    ReplyDelete
  4. Your article is very good and useful, thank you very much for this content.: usefull site

    ReplyDelete
  5. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru ASP.NET Essential Training Online . Nowadays Dot Net has tons of job opportunities on various vertical industry.



    or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.

    ReplyDelete