Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gimler/sfoauthplugin

Login with facebook, google or another oauth provider
https://github.com/gimler/sfoauthplugin

Last synced: 6 days ago
JSON representation

Login with facebook, google or another oauth provider

Awesome Lists containing this project

README

        

# sfOAuth plugin #

The `sfOAuthPlugin` is a symfony plugin that provides authentication and
authorization features over oauth for `sfDoctrineGuardPlugin`.

## Installation ##

This plugin requires oauth pecl extension for oauth 1.0. The propel version is not implemented yet.

* Install the plugin (via a package)

symfony plugin:install sfOAuthPlugin

* Install the plugin (via a Subversion checkout)

svn co http//svn.symfony-project.com/plugins/sfOAuthPlugin/branch/1.4 plugins/sfOAuthPlugin

* Activate the plugin in the `config/ProjectConfiguration.class.php`

[php]
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->enablePlugins(array(
'sfDoctrinePlugin',
'sfDoctrineGuardPlugin',
'sfOAuthPlugin',
'...'
));
}
}

* Enable one or more modules in your `settings.yml` (optional)

all:
.settings:
enabled_modules: [default, sfAuth, sfOAuth]

* Add oauth provider configuration in your `app.yml`

all:
sf_oauth_plugin:
enabled: true
provider:
facebook:
enabled: true
protocol: 2
consumer_key: xxxxxxxxxxxxxxx
consumer_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
scope: email
authorize_url: https://graph.facebook.com/oauth/authorize
access_url: https://graph.facebook.com/oauth/access_token
profile_url: https://graph.facebook.com/me
google:
enabled: true
protocol: 1
consumer_key: anonymous
consumer_secret: anonymous
scope: https://www.googleapis.com/auth/userinfo#email
request_url: https://www.google.com/accounts/OAuthGetRequestToken
authorize_url: https://www.google.com/accounts/OAuthAuthorizeToken
access_url: https://www.google.com/accounts/OAuthGetAccessToken
email_url: https://www.googleapis.com/userinfo/email

* Clear you cache

symfony cc