Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Login with facebook, google or another oauth provider
PHP
branch: master
Failed to load latest commit information.
config
lib
modules/sfOAuth use retrieveByUsernameOrEmailAddress method instate of findOneByEmail…
README

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
Something went wrong with that request. Please try again.