SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Facebook Connect Tutorial

       Prateek Dayal

        Muziboo.com


       Mar 7th, 2010
Resources




      Code: http://github.com/prateekdayal/fb-tutorial
      This Presentation: http://www.slideshare.net/prateek.
      dayal/facebook-connect-tutorial
      FB Connect’s Docs:
      http://developers.facebook.com/connect.php
Setting up a New App




      Install the ’Developer App’ in Facebook
      Create a new application (in fact two: one for production and
      the other for testing)
      The canvas callback url should point to your website (or your
      dev machine)
SSH Tunnel Setup




      Problem: You need to access your dev machine over the
      internet and you don’t have a public IP
      Solution: Use a ssh tunnel
      On Linux machines
          In /etc/ssh/sshd config put GatewayPorts yes
          Restart the ssh server prateekdayal: # /etc/init.d/ssh
          restart
Starting the Tunnel on localhost




       Lets assume that you want to forward the local port 3000 to
       port 3333 on your server (ex: prateekdayal.net)
       prateek@marvin: /work/talks/acm$ ssh
       prateek@prateekdayal.net -gNR 3333:localhost:3000
       You can now access http://localhost:3000 at
       http://www.prateekdayal.net:3333
Cross Domain Receiver File



      Problem: Ajax calls from your domain to Facebook.com and
      passing data from Facebook.com to your domain
      Solution: Cross Domain Receiver File
      A technique for passing data between different domains
      Used for detecting login status, setting fb cookies on your
      domain etc
      You can get the file from Facebook’s Dev site
      You have to place it relative to the root directory of your app
      <site root>/xd receiver.html
Lets build a quick app




   Objective: Comment on a blogpost with your Facebook ID and
   post the comment on your news feed
Creating the Login page



         File: public/fb-connect.html
         Include FB Connect’s Javascript code
         I have also included prototype.js to make manipulate the
         DOM more easily
         Add a form and ’Login with Facebook’ button
         Add the JS code to render fbml tags   1




     1
       http://wiki.developers.facebook.com/index.php/Connect/
   Authorization_Websites
Show User Info




         File: public/fb-connect-show-info.html
         Use XFBML tags to show name and profile pic   2

         Also provide a Logout button   3




     2
       http://wiki.developers.facebook.com/index.php/XFBML
     3
       http://wiki.developers.facebook.com/index.php/Logging_Out_
   And_Disconnecting
Detecting the Login State



         File: public/fb-connect-detect-login-state.html
         Problem: Every time we refresh the page we have to login
         again
         Solution: Pass ifUserConnected and ifUserNotConnected
         options to FB Connect’s init function 4
         Remove the separate handlers for login & logout
         This can be used to automatically login users if they are
         logged into FB (single sign-on)




     4
       http:
   //wiki.developers.facebook.com/index.php/Detecting_Connect_Status
Posting to News Feed




         File: public/fb-connect-feed-story.html
         We can use FB.Connect.streamPublish to publish to News
         Feed 5
         FB allows pictures, mp3, flash etc to be attached to the feed




     5
       http://wiki.developers.facebook.com/index.php/Implementing_
   Feed_Publishing_from_your_Website_or_Application
Server side stuff


       Problem: You want to let users login with FB and connect
       existing accounts
       Solution: Read cookies set by FB (on your domain) to get
       user id and session id
       FB User ID can be used to identify the user on next login and
       connect with your auth system
       Session ID can be used to make FB API calls (to fetch
       detailed user info etc)
       Php, Ruby on Rails and other languages have libraries
       available to make all this easy
Advanced Features




      Extended session permission
      Ask for user’s primary email address
      Friend recommendation and invitation
A note on Platform Policies




          Most of the data (including name) cannot be cached for more
          than 24 hours
          If a user de-authorizes your app, you need to delete data
          received by API (and not direct submission)
          Many more guidelines   6




     6
         http://wiki.developers.facebook.com/index.php/Storable_Data
Questions?




      prateek@muziboo.com
      @prateekdayal
      http://www.prateekdayal.net
      http://devblog.muziboo.com

Weitere ähnliche Inhalte

Was ist angesagt?

Facebook Connect Presentation 08 10 2008
Facebook Connect Presentation 08 10 2008Facebook Connect Presentation 08 10 2008
Facebook Connect Presentation 08 10 2008Karl Bunyan
 
Facebook api
Facebook api Facebook api
Facebook api snipermkd
 
Facebook API in the Real World - Myles Noton - Miniclip
Facebook API in the Real World - Myles Noton - MiniclipFacebook API in the Real World - Myles Noton - Miniclip
Facebook API in the Real World - Myles Noton - MiniclipMyles Noton
 
Facebook Connect Integration
Facebook Connect IntegrationFacebook Connect Integration
Facebook Connect Integrationmujahidslideshare
 
Rapid Development With CakePHP
Rapid Development With CakePHPRapid Development With CakePHP
Rapid Development With CakePHPEdureka!
 
Facebook Open Graph Tech Requirements
Facebook Open Graph Tech RequirementsFacebook Open Graph Tech Requirements
Facebook Open Graph Tech RequirementsAffinitive
 
The Face Behind Facebook
The Face Behind FacebookThe Face Behind Facebook
The Face Behind FacebookCory Bohon
 
Webinar: PHP and MySQL - Server-side Scripting Language for Web Development
Webinar: PHP and MySQL - Server-side Scripting Language for Web Development  Webinar: PHP and MySQL - Server-side Scripting Language for Web Development
Webinar: PHP and MySQL - Server-side Scripting Language for Web Development Edureka!
 
Uk Nuke Facebook Connect Authentication For Dot Net Nuke
Uk Nuke Facebook Connect Authentication For Dot Net NukeUk Nuke Facebook Connect Authentication For Dot Net Nuke
Uk Nuke Facebook Connect Authentication For Dot Net NukeStuart Lodge
 
AIESEC CMS - User guide
AIESEC CMS - User guideAIESEC CMS - User guide
AIESEC CMS - User guideBogdan Rusu
 
Custom Template for Joomla! 3
Custom Template for Joomla! 3Custom Template for Joomla! 3
Custom Template for Joomla! 3Carly Willats
 
Responsive WEB APP using cakePHP
Responsive WEB APP using cakePHPResponsive WEB APP using cakePHP
Responsive WEB APP using cakePHPEdureka!
 
Workshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKWorkshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKDimitar Danailov
 
Facebook Platform - Tech
Facebook Platform - TechFacebook Platform - Tech
Facebook Platform - TechDavid Zhuang
 
APEX navigation concepts
APEX navigation conceptsAPEX navigation concepts
APEX navigation conceptsTobias Arnhold
 
Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)Colin Su
 
Reff 04 macme-installation-tutorial
Reff 04 macme-installation-tutorialReff 04 macme-installation-tutorial
Reff 04 macme-installation-tutorialSalvatore Iaconesi
 
UkNuke Facebook Connect Authentication For DotNetNuke 5
UkNuke Facebook Connect Authentication For DotNetNuke 5UkNuke Facebook Connect Authentication For DotNetNuke 5
UkNuke Facebook Connect Authentication For DotNetNuke 5Stuart Lodge
 
Facebook Apps Development 101 (Java)
Facebook Apps Development 101 (Java)Facebook Apps Development 101 (Java)
Facebook Apps Development 101 (Java)Damon Widjaja
 

Was ist angesagt? (20)

Facebook Connect Presentation 08 10 2008
Facebook Connect Presentation 08 10 2008Facebook Connect Presentation 08 10 2008
Facebook Connect Presentation 08 10 2008
 
Facebook api
Facebook api Facebook api
Facebook api
 
Dbs-Week5-Class-Exercises
Dbs-Week5-Class-ExercisesDbs-Week5-Class-Exercises
Dbs-Week5-Class-Exercises
 
Facebook API in the Real World - Myles Noton - Miniclip
Facebook API in the Real World - Myles Noton - MiniclipFacebook API in the Real World - Myles Noton - Miniclip
Facebook API in the Real World - Myles Noton - Miniclip
 
Facebook Connect Integration
Facebook Connect IntegrationFacebook Connect Integration
Facebook Connect Integration
 
Rapid Development With CakePHP
Rapid Development With CakePHPRapid Development With CakePHP
Rapid Development With CakePHP
 
Facebook Open Graph Tech Requirements
Facebook Open Graph Tech RequirementsFacebook Open Graph Tech Requirements
Facebook Open Graph Tech Requirements
 
The Face Behind Facebook
The Face Behind FacebookThe Face Behind Facebook
The Face Behind Facebook
 
Webinar: PHP and MySQL - Server-side Scripting Language for Web Development
Webinar: PHP and MySQL - Server-side Scripting Language for Web Development  Webinar: PHP and MySQL - Server-side Scripting Language for Web Development
Webinar: PHP and MySQL - Server-side Scripting Language for Web Development
 
Uk Nuke Facebook Connect Authentication For Dot Net Nuke
Uk Nuke Facebook Connect Authentication For Dot Net NukeUk Nuke Facebook Connect Authentication For Dot Net Nuke
Uk Nuke Facebook Connect Authentication For Dot Net Nuke
 
AIESEC CMS - User guide
AIESEC CMS - User guideAIESEC CMS - User guide
AIESEC CMS - User guide
 
Custom Template for Joomla! 3
Custom Template for Joomla! 3Custom Template for Joomla! 3
Custom Template for Joomla! 3
 
Responsive WEB APP using cakePHP
Responsive WEB APP using cakePHPResponsive WEB APP using cakePHP
Responsive WEB APP using cakePHP
 
Workshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKWorkshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDK
 
Facebook Platform - Tech
Facebook Platform - TechFacebook Platform - Tech
Facebook Platform - Tech
 
APEX navigation concepts
APEX navigation conceptsAPEX navigation concepts
APEX navigation concepts
 
Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)
 
Reff 04 macme-installation-tutorial
Reff 04 macme-installation-tutorialReff 04 macme-installation-tutorial
Reff 04 macme-installation-tutorial
 
UkNuke Facebook Connect Authentication For DotNetNuke 5
UkNuke Facebook Connect Authentication For DotNetNuke 5UkNuke Facebook Connect Authentication For DotNetNuke 5
UkNuke Facebook Connect Authentication For DotNetNuke 5
 
Facebook Apps Development 101 (Java)
Facebook Apps Development 101 (Java)Facebook Apps Development 101 (Java)
Facebook Apps Development 101 (Java)
 

Andere mochten auch

Facebook Connect in 3 Hours
Facebook Connect in 3 HoursFacebook Connect in 3 Hours
Facebook Connect in 3 HoursRyan Merket
 
Facebook Connect For Your 
Website
Facebook Connect For Your 
WebsiteFacebook Connect For Your 
Website
Facebook Connect For Your 
WebsiteOzkan Altuner
 
Facebook Login and Open Graph
Facebook Login and Open GraphFacebook Login and Open Graph
Facebook Login and Open GraphTimon Hartung
 
Facebook Connect
Facebook ConnectFacebook Connect
Facebook Connectmikamai
 
The Introductory Guide to Social Login
The Introductory Guide to Social LoginThe Introductory Guide to Social Login
The Introductory Guide to Social LoginLoginRadius
 
Analysis of 150 Websites Using Facebook Login
Analysis of 150 Websites Using Facebook LoginAnalysis of 150 Websites Using Facebook Login
Analysis of 150 Websites Using Facebook LoginNeolane, Inc.
 
Facebook Login & Open Graph Introduction
Facebook Login & Open Graph IntroductionFacebook Login & Open Graph Introduction
Facebook Login & Open Graph IntroductionEric Ping
 
Facebook Connect 5 Things You Wish You Had Known Before You Started
Facebook Connect   5 Things You Wish You Had Known Before You StartedFacebook Connect   5 Things You Wish You Had Known Before You Started
Facebook Connect 5 Things You Wish You Had Known Before You StartedToby Beresford
 
Facebook Connect Design Patterns and Metrics
Facebook Connect Design Patterns and MetricsFacebook Connect Design Patterns and Metrics
Facebook Connect Design Patterns and MetricsHiten Shah
 
Facebook Powerpoint
Facebook PowerpointFacebook Powerpoint
Facebook Powerpointmyra14
 

Andere mochten auch (11)

Facebook Connect
Facebook ConnectFacebook Connect
Facebook Connect
 
Facebook Connect in 3 Hours
Facebook Connect in 3 HoursFacebook Connect in 3 Hours
Facebook Connect in 3 Hours
 
Facebook Connect For Your 
Website
Facebook Connect For Your 
WebsiteFacebook Connect For Your 
Website
Facebook Connect For Your 
Website
 
Facebook Login and Open Graph
Facebook Login and Open GraphFacebook Login and Open Graph
Facebook Login and Open Graph
 
Facebook Connect
Facebook ConnectFacebook Connect
Facebook Connect
 
The Introductory Guide to Social Login
The Introductory Guide to Social LoginThe Introductory Guide to Social Login
The Introductory Guide to Social Login
 
Analysis of 150 Websites Using Facebook Login
Analysis of 150 Websites Using Facebook LoginAnalysis of 150 Websites Using Facebook Login
Analysis of 150 Websites Using Facebook Login
 
Facebook Login & Open Graph Introduction
Facebook Login & Open Graph IntroductionFacebook Login & Open Graph Introduction
Facebook Login & Open Graph Introduction
 
Facebook Connect 5 Things You Wish You Had Known Before You Started
Facebook Connect   5 Things You Wish You Had Known Before You StartedFacebook Connect   5 Things You Wish You Had Known Before You Started
Facebook Connect 5 Things You Wish You Had Known Before You Started
 
Facebook Connect Design Patterns and Metrics
Facebook Connect Design Patterns and MetricsFacebook Connect Design Patterns and Metrics
Facebook Connect Design Patterns and Metrics
 
Facebook Powerpoint
Facebook PowerpointFacebook Powerpoint
Facebook Powerpoint
 

Ähnlich wie Facebook Connect Tutorial

Download PowerPoint Project on social programming for engineering students
Download PowerPoint Project on social programming for engineering studentsDownload PowerPoint Project on social programming for engineering students
Download PowerPoint Project on social programming for engineering studentsSkyingBlogger
 
BrownSites: Building and Managing a CMS Infrastructure for Higher Ed
BrownSites: Building and Managing a CMS Infrastructure for Higher EdBrownSites: Building and Managing a CMS Infrastructure for Higher Ed
BrownSites: Building and Managing a CMS Infrastructure for Higher EdAlozie Nwosu
 
Facebook 3rd Party Api
Facebook 3rd Party ApiFacebook 3rd Party Api
Facebook 3rd Party ApiYoss Cohen
 
Fabian Williams SharePoint Saturday New York BCS Deck
Fabian Williams SharePoint Saturday New York BCS DeckFabian Williams SharePoint Saturday New York BCS Deck
Fabian Williams SharePoint Saturday New York BCS DeckFabian Williams
 
Facebook API
Facebook APIFacebook API
Facebook APIsnipermkd
 
Leveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsLeveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsDavid Keener
 
Building Facebook Apps
Building Facebook AppsBuilding Facebook Apps
Building Facebook AppsDavid Keener
 
Flash Development Guide
Flash Development GuideFlash Development Guide
Flash Development GuideStanley Fok
 
Facebook Messenger Platform Framework
Facebook Messenger Platform FrameworkFacebook Messenger Platform Framework
Facebook Messenger Platform FrameworkRam Murat Sharma
 
Developing Joomla Extensions JUG Bangladesh meetup dhaka-2012
Developing Joomla Extensions JUG  Bangladesh meetup dhaka-2012Developing Joomla Extensions JUG  Bangladesh meetup dhaka-2012
Developing Joomla Extensions JUG Bangladesh meetup dhaka-2012Sabuj Kundu
 
Facebook Application Crash Course
Facebook Application Crash CourseFacebook Application Crash Course
Facebook Application Crash CourseXavier Ochoa
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 

Ähnlich wie Facebook Connect Tutorial (20)

Download PowerPoint Project on social programming for engineering students
Download PowerPoint Project on social programming for engineering studentsDownload PowerPoint Project on social programming for engineering students
Download PowerPoint Project on social programming for engineering students
 
BrownSites: Building and Managing a CMS Infrastructure for Higher Ed
BrownSites: Building and Managing a CMS Infrastructure for Higher EdBrownSites: Building and Managing a CMS Infrastructure for Higher Ed
BrownSites: Building and Managing a CMS Infrastructure for Higher Ed
 
Facebook 3rd Party Api
Facebook 3rd Party ApiFacebook 3rd Party Api
Facebook 3rd Party Api
 
Facebook appsincloud
Facebook appsincloudFacebook appsincloud
Facebook appsincloud
 
Addon Features FileMaker 13
Addon Features FileMaker 13Addon Features FileMaker 13
Addon Features FileMaker 13
 
Fabian Williams SharePoint Saturday New York BCS Deck
Fabian Williams SharePoint Saturday New York BCS DeckFabian Williams SharePoint Saturday New York BCS Deck
Fabian Williams SharePoint Saturday New York BCS Deck
 
Facebook API
Facebook APIFacebook API
Facebook API
 
Leveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsLeveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook Apps
 
Facebook Coin
Facebook CoinFacebook Coin
Facebook Coin
 
Mule with facebook
Mule with facebookMule with facebook
Mule with facebook
 
Mule with facebook
Mule with facebookMule with facebook
Mule with facebook
 
Building Facebook Apps
Building Facebook AppsBuilding Facebook Apps
Building Facebook Apps
 
Admin Panel
Admin Panel Admin Panel
Admin Panel
 
Build social apps for Facebook
Build social apps for FacebookBuild social apps for Facebook
Build social apps for Facebook
 
Flash Development Guide
Flash Development GuideFlash Development Guide
Flash Development Guide
 
The social media developer
The social media developer The social media developer
The social media developer
 
Facebook Messenger Platform Framework
Facebook Messenger Platform FrameworkFacebook Messenger Platform Framework
Facebook Messenger Platform Framework
 
Developing Joomla Extensions JUG Bangladesh meetup dhaka-2012
Developing Joomla Extensions JUG  Bangladesh meetup dhaka-2012Developing Joomla Extensions JUG  Bangladesh meetup dhaka-2012
Developing Joomla Extensions JUG Bangladesh meetup dhaka-2012
 
Facebook Application Crash Course
Facebook Application Crash CourseFacebook Application Crash Course
Facebook Application Crash Course
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 

Kürzlich hochgeladen

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Kürzlich hochgeladen (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

Facebook Connect Tutorial

  • 1. Facebook Connect Tutorial Prateek Dayal Muziboo.com Mar 7th, 2010
  • 2. Resources Code: http://github.com/prateekdayal/fb-tutorial This Presentation: http://www.slideshare.net/prateek. dayal/facebook-connect-tutorial FB Connect’s Docs: http://developers.facebook.com/connect.php
  • 3. Setting up a New App Install the ’Developer App’ in Facebook Create a new application (in fact two: one for production and the other for testing) The canvas callback url should point to your website (or your dev machine)
  • 4.
  • 5. SSH Tunnel Setup Problem: You need to access your dev machine over the internet and you don’t have a public IP Solution: Use a ssh tunnel On Linux machines In /etc/ssh/sshd config put GatewayPorts yes Restart the ssh server prateekdayal: # /etc/init.d/ssh restart
  • 6. Starting the Tunnel on localhost Lets assume that you want to forward the local port 3000 to port 3333 on your server (ex: prateekdayal.net) prateek@marvin: /work/talks/acm$ ssh prateek@prateekdayal.net -gNR 3333:localhost:3000 You can now access http://localhost:3000 at http://www.prateekdayal.net:3333
  • 7. Cross Domain Receiver File Problem: Ajax calls from your domain to Facebook.com and passing data from Facebook.com to your domain Solution: Cross Domain Receiver File A technique for passing data between different domains Used for detecting login status, setting fb cookies on your domain etc You can get the file from Facebook’s Dev site You have to place it relative to the root directory of your app <site root>/xd receiver.html
  • 8.
  • 9. Lets build a quick app Objective: Comment on a blogpost with your Facebook ID and post the comment on your news feed
  • 10. Creating the Login page File: public/fb-connect.html Include FB Connect’s Javascript code I have also included prototype.js to make manipulate the DOM more easily Add a form and ’Login with Facebook’ button Add the JS code to render fbml tags 1 1 http://wiki.developers.facebook.com/index.php/Connect/ Authorization_Websites
  • 11.
  • 12. Show User Info File: public/fb-connect-show-info.html Use XFBML tags to show name and profile pic 2 Also provide a Logout button 3 2 http://wiki.developers.facebook.com/index.php/XFBML 3 http://wiki.developers.facebook.com/index.php/Logging_Out_ And_Disconnecting
  • 13.
  • 14. Detecting the Login State File: public/fb-connect-detect-login-state.html Problem: Every time we refresh the page we have to login again Solution: Pass ifUserConnected and ifUserNotConnected options to FB Connect’s init function 4 Remove the separate handlers for login & logout This can be used to automatically login users if they are logged into FB (single sign-on) 4 http: //wiki.developers.facebook.com/index.php/Detecting_Connect_Status
  • 15. Posting to News Feed File: public/fb-connect-feed-story.html We can use FB.Connect.streamPublish to publish to News Feed 5 FB allows pictures, mp3, flash etc to be attached to the feed 5 http://wiki.developers.facebook.com/index.php/Implementing_ Feed_Publishing_from_your_Website_or_Application
  • 16.
  • 17. Server side stuff Problem: You want to let users login with FB and connect existing accounts Solution: Read cookies set by FB (on your domain) to get user id and session id FB User ID can be used to identify the user on next login and connect with your auth system Session ID can be used to make FB API calls (to fetch detailed user info etc) Php, Ruby on Rails and other languages have libraries available to make all this easy
  • 18.
  • 19. Advanced Features Extended session permission Ask for user’s primary email address Friend recommendation and invitation
  • 20. A note on Platform Policies Most of the data (including name) cannot be cached for more than 24 hours If a user de-authorizes your app, you need to delete data received by API (and not direct submission) Many more guidelines 6 6 http://wiki.developers.facebook.com/index.php/Storable_Data
  • 21. Questions? prateek@muziboo.com @prateekdayal http://www.prateekdayal.net http://devblog.muziboo.com