Index: openacs-4/packages/facebook-api/www/doc/index.html
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/facebook-api/www/doc/index.html,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/facebook-api/www/doc/index.html 15 Dec 2007 11:27:07 -0000 1.1
+++ openacs-4/packages/facebook-api/www/doc/index.html 3 Nov 2009 06:22:06 -0000 1.2
@@ -14,8 +14,8 @@
Authors :
Dave Bauer (dave@solutiongrove.com)
Hamilton Chua (ham@solutiongrove.com)
-
Last Updated : 10/27/07
-
Version : 0.1d
+
Last Updated : 1/29/08
+
Version : 0.2d
Overview
@@ -66,20 +66,21 @@
}
# check that we are passed an auth_token
-# if we don't have an auth_token, redirect to
-# http://apps.facebook.com/your_application_name
-# to get one.
-# if there's no auth_token, it's most likely that
-# the user got here without going thru facebook
+# an auth_token allows us to get a session_key from facebook
+# if auth_token is empty, it is most likely that we already have a
+# session_key in fb_sig_session_key
if {$auth_token ne ""} {
- facebook_api::get_session_from_token -package_key "your_package_key" -auth_token $auth_token -url "http://apps.facebook.com/canvas_page_url"
+ set session_info [facebook_api::get_session_from_token -package_key $package_key -auth_token $auth_token -url $app_url]
+ set fb_sig_session_key [lindex $session_info 0]
+ set fb_sig_user [lindex $session_info 1]
}
-# check that we are passed fb_sig_session_key
+# check that we have an fb_sig_session_key
# if we don't have this parameter it means that
-# the user doesn't have this app installed
-# you'll need to redirect to the facebook add page
+# the user didn't get here from facebook
+# but rather directly
+# ask the user to login or add the app
if { [exists_and_not_null fb_sig_session_key] } {
@@ -105,13 +106,26 @@
Make sure that you choose Use iframe.
Click submit
-Your new application shoud now be listed under My Applications.
+Your new application should now be listed under My Applications.
Click on it to add your new application to your list of Facebook Applications.
Click on the name of your application from your list of applications to launch your app
The page should return JSON with your friends data.
-
+Authenticating with Facebook
+As of version 0.2d, the facebook api package has procs that allow you to do the following ....
+
+- Request for a session key outside of facebook
+- Authenticate against facebook on your OpenACS site or web application.
+- Store the session_key of a user for use in subsequent requests
+
+For more information about authenticating with facebook refer to this page.
+
The facebook api package now has two new tables :
+
+- fb_users - stores the uid, auth_token, session_key and session_expire parameters
+- oacs_fb_user_map - mapping table for openacs user_id and facebook uid values
+
+Authenticating with facebook is useful if you want to run a web application outside of the facebook user interface but still have access to data from facebook.