]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Facebook/README
OAuth: Fix rare problem in which request tokens were sometimes being
[quix0rs-gnu-social.git] / plugins / Facebook / README
1 Facebook Plugin
2 ===============
3
4 This plugin allows you to use Facebook Connect with StatusNet, provides
5 a Facebook canvas application for your users, and allows them to update
6 their Facebook statuses from StatusNet.
7
8 Facebook Connect
9 ----------------
10
11 Facebook connect allows users to register and login using nothing but their
12 Facebook credentials. With Facebook Connect, your users can:
13
14 - Authenticate (register/login/logout -- works similar to OpenID)
15 - Associate an existing StatusNet account with a Facebook account
16 - Disconnect a Facebook account from a StatusNet account
17
18 Built-in Facebook Application
19 -----------------------------
20
21 The plugin also installs a StatusNet Facebook canvas application that
22 allows your users to automatically update their Facebook status with
23 their latest notices, invite their friends to use the app (and thus your
24 site), view their notice timelines and post notices -- all from within
25 Facebook.  The application is built into the StatusNet Facebook plugin
26 and runs on your host.
27
28 Quick setup instructions*
29 -------------------------
30
31 Install the Facebook Developer application on Facebook:
32
33     http://www.facebook.com/developers/
34
35 Use it to create a new application and generate an API key and secret.
36 You will need the key and secret so cut-n-paste them into your text
37 editor or write them down.
38
39 In Facebook's application editor, specify the following URLs for your app:
40
41 - Canvas Callback URL         : http://example.net/mublog/facebook/app/
42 - Post-Remove Callback URL    : http://example.net/mublog/facebook/app/remove
43 - Post-Authorize Redirect URL : http://apps.facebook.com/yourapp/
44 - Canvas Page URL             : http://apps.facebook.com/yourapp/
45 - Connect URL                 : http://example.net/mublog/
46
47     *** ATTENTION ***
48     These URLs have changed slightly since StatusNet version 0.8.1,
49     so if you have been using the Facebook app previously, you will
50     need to update your configuration!
51
52 Replace "example.net" with your host's URL, "mublog" with the path to your
53 StatusNet installation, and 'yourapp' with the name of the Facebook
54 application you created. (If you don't have "Fancy URLs" on, you'll need to
55 change http://example.net/mublog/ to http://example.net/mublog/index.php/).
56
57 Additionally, Choose "Web" for Application type in the Advanced tab. In the
58 "Canvas setting" section, choose the "FBML" for Render Method, "Smart Size"
59 for IFrame size, and "Full width (760px)" for Canvas Width. Everything else
60 can be left with default values.
61
62 * NOTE: For more under-the-hood detailed instructions about setting up a
63         Facebook application and getting an API key, check out the
64         following pages on the Facebook wiki:
65
66     http://wiki.developers.facebook.com/index.php/Connect/Setting_Up_Your_Site
67     http://wiki.developers.facebook.com/index.php/Creating_your_first_application
68
69 Finally you must activate the plugin by adding it in your config.php
70 (this is where you'll need the API key and secret generated earlier):
71
72     addPlugin(
73         'Facebook',
74         array(
75             'apikey' => 'YOUR_APIKEY',
76             'secret' => 'YOUR_SECRET'
77         )
78     );
79
80 Administration Panel
81 --------------------
82
83 As of StatusNet 0.9.0 you can alternatively specify the key and secret
84 via a Facebook administration panel from within StatusNet, in which case
85 you can just add:
86
87     addPlugin('Facebook');
88
89 to activate the plugin.
90
91 NOTE: To enable the administration panel you'll need to add it to the
92 list of active administration panels, e.g.:
93
94     $config['admin']['panels'][] = 'facebook';
95
96 and of course you'll need a user with the administrative role to access
97 it and input the API key and secret (see: scripts/userrole.php).
98
99 Testing It Out
100 --------------
101
102 If the Facebook plugin is enabled and working, there will be a new Facebook
103 Connect Settings tab under each user's Connect menu. Users can connect and
104 disconnect* to their Facebook accounts from it.
105
106 To try out the plugin, fire up your browser and connect to:
107
108     http://example.net/mublog/main/facebooklogin
109
110 or, if you do not have fancy URLs turned on:
111
112     http://example.net/mublog/index.php/main/facebooklogin
113
114 You should see a page with a blue button that says: "Connect with Facebook"
115 and you should be able to login or register.
116
117 From within Facebook, you should also be able to get to the Facebook
118 application, and run it by hitting the link you specified above when
119 configuring it:
120
121     http://apps.facebook.com/yourapp/
122
123 That link should be present you with a login screen.  After logging in to
124 the app, you are given the option to update their Facebook status via
125 StatusNet.
126
127 * Note: Before a user can disconnect from Facebook, she must set a normal
128   StatusNet password.  Otherwise, she might not be able to login in to her
129   account in the future.  This is usually only required for users who have
130   used Facebook Connect to register their StatusNet account, and therefore
131   haven't already set a local password.
132
133 Offline Queue Handling
134 ----------------------
135
136 For larger sites needing better performance it's possible to enable
137 queuing and have users' notices posted to Facebook via a separate
138 "offline" process -- FacebookQueueHandler (facebookqueuhandler.php in
139 the Facebook plugin directory).  It will run automatically if you have
140 enabled StatusNet's offline queueing subsystem.  See the "Queues and
141 daemons" section in the StatusNet README for more about queuing.
142
143
144 TODO
145 ----
146
147 - Make Facebook Connect work for authentication for multi-site setups
148   (e.g.: *.status.net)
149 - Posting to Facebook user streams using only Facebook Connect
150 - Invite Facebook friends to use your StatusNet installation via Facebook
151   Connect
152 - Auto-subscribe Facebook friends already using StatusNet
153 - Share StatusNet favorite notices to your Facebook stream
154 - Allow users to update their Facebook statuses once they have authenticated
155   with Facebook Connect (no need for them to use the Facebook app if they
156   don't want to).
157 - Import a user's Facebook updates into StatusNet