Code Monkey home page Code Monkey logo

sffacebookconnectplugin's Introduction

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

        $ svn co http://svn.symfony-project.com/plugins/sfFacebookConnectPlugin/trunk sfFacebookConnectPlugin


  * Create your application on Facebook

        http://www.facebook.com/developers/


  * Configure your app.yml file with all the correct settings

    # 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

        # 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(4)
        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 make myUser.class.php extend sfFacebookUser

  * 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

sffacebookconnectplugin's People

Contributors

zecho avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.