https://github.com/dunglas/kdDoctrineGuardFacebookConnectPlugin
Facebook Connect symfony plugin (extends sfGuardPlugin)
https://github.com/dunglas/kdDoctrineGuardFacebookConnectPlugin
Last synced: about 2 months ago
JSON representation
Facebook Connect symfony plugin (extends sfGuardPlugin)
- Host: GitHub
- URL: https://github.com/dunglas/kdDoctrineGuardFacebookConnectPlugin
- Owner: dunglas
- License: mit
- Archived: true
- Created: 2011-03-12T07:45:00.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2018-04-25T20:54:26.000Z (about 7 years ago)
- Last Synced: 2024-11-08T01:37:27.605Z (7 months ago)
- Language: PHP
- Homepage: http://dunglas.fr
- Size: 97.7 KB
- Stars: 16
- Watchers: 6
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Facebook Connect for symfony and sfGuard
_kdDoctrineGuardFacebookConnectPlugin_ provides an easy way to sign into a symfony 1 application using a Facebook account.
It extends [_sfDoctrineGuardPlugin_](http://www.symfony-project.org/plugins/sfDoctrineGuardPlugin).## Installation
* Install and configure [_sfDoctrineGuardPlugin_](http://www.symfony-project.org/plugins/sfDoctrineGuardPlugin)
* Install _kdDoctrineGuardFacebookConnectPlugin_
```sh
# Example using git
git submodule add http://github.com/dunglas/kdDoctrineGuardFacebookConnectPlugin.git plugins/kdDoctrineGuardFacebookConnectPlugin
```
* Create [your Facebook application](http://www.facebook.com/developers/)
* Enable the plugin in the `config/ProjectConfiguration.class.php` file after _sfDoctrineGuardPlugin_.```php
class ProjectConfiguration extends sfProjectConfiguration {
public function setup()
{
$this->enablePlugins('sfDoctrinePlugin');
$this->enablePlugins('sfDoctrineGuardPlugin');
$this->enablePlugins('kdDoctrineGuardFacebookConnectPlugin');
}
}
```
* Rebuild your database and classes```sh
php symfony doctrine:build --all --and-load
```* Edit `app.yml` to match your Facebook application settings
```yaml
all:
facebook:
appId: xxx # Your app id
secret: yyy # Your app secret
cookie: true # Use cookie
script_lang: en_US # Facebook UI language
```* Edit `filters.yml` to enable the FacebookConnect filter
```yaml
rendering: ~
security: ~
# Facebook Connect
facebook:
class: kdDoctrineGuardFacebookConnectFilter
# Remember me
remember_me:
class: sfGuardRememberMeFilter
# insert your own filters here
cache: ~
execution: ~
```
* Enable the _kdGuardAuthFacebookConnect_ module and set is a signin module in `settings.yml````yaml
all:
.settings:
# ...
enabled_modules: [default, sfGuardAuth, kdGuardAuthFacebookConnect]
login_module: kdGuardAuthFacebookConnect
login_action: signin
```
* Add the Facebook Login button JavaScript before the body end tag in your app's layout
```php
...