-
Notifications
You must be signed in to change notification settings - Fork 25
/
README
107 lines (77 loc) · 3.21 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
sfFacebookConnectPlugin
=======================
The sfFacebookConnect plugin :
* helps easily setup a Facebook Connect authentification on a symfony project using sfGuardUser
* is also a good wrapper to create a Facebook application using symfony
Installation
------------
* Install the plugin : the __git__ and recommanded way
$ git submodule add http://github.com/fabriceb/sfFacebookConnectPlugin.git plugins/sfFacebookConnectPlugin
$ cd plugins/sfFacebookConnectPlugin
$ git submodule init # add the facebook php-sdk as a submodule
$ git submodule update
# or all in one
$ git submodule add --recursive http://github.com/fabriceb/sfFacebookConnectPlugin.git plugins/sfFacebookConnectPlugin
* Create your application on Facebook
http://www.facebook.com/developers/
* Configure your `app.yml` file with all the correct settings
[yml]
# default values
all:
facebook:
api_key: xxx
api_secret: xxx
api_id: xxx
redirect_after_connect: false
redirect_after_connect_url: ''
connect_signin_url: 'sfFacebookConnectAuth/signin'
app_url: '/my-app' # the facebook application canvas url
guard_adapter: ~ # to customise a guard adapter
js_framework: none # none, jQuery or prototype.
# It is highly recommended to use a js framework if you want a correct experience in IE
sf_guard_plugin:
profile_class: sfGuardUserProfile
profile_field_name: user_id
profile_facebook_uid_name: facebook_uid
profile_email_name: email
profile_email_hash_name: email_hash
facebook_connect:
load_routing: true
user_permissions: []
* Modify your `sfGaurdUserProfile` schema to add the 3 new columns needed
[yml]
# Doctrine schema sample
sfGuardUserProfile:
tableName: sf_guard_user_profile
columns:
user_id: integer(4)
first_name: varchar(20)
last_name: varchar(20)
facebook_uid: integer(5) # Must be BIGINT to fit Facebook's uids
email: varchar(255)
email_hash: varchar(255)
relations:
sfGuardUser:
type: one
foreignType: one
class: sfGuardUser
local: user_id
foreign: id
onDelete: cascade
foreignAlias: Profile
* Enable the auth module in your `settings.yml`: `sfFacebookConnectAuth`
[php]
all:
.settings:
enabled_modules: [default, sfFacebookConnectAuth]
* (Optional) Enable the sample module in your `settings.yml`: `sfFacebookConnectDemo`
[php]
all:
.settings:
enabled_modules: [default, sfFacebookConnectAuth, sfFacebookConnectDemo]
* Eventually use the sfFacebook filters
* etc. A lot still needs to be documented.
* Clear your cache
$ php symfony cc
* Publish the plugin assets
$ php symfony plugin:publish-assets