Coder Social home page Coder Social logo

oauthbundle's Introduction

OAuthBundle

OAuthBundle for Symfony2 that uses Twitter and Facebook

Installation

  1. Add my fork of twitteroauth, the facebook php sdk and the OAuthBundle as submodule

    git submodule add git://github.com/ruudk/twitteroauth.git vendor/twitteroauth

    git submodule add git://github.com/facebook/php-sdk.git vendor/facebook-php-sdk

    git submodule add git://github.com/ruudk/OAuthBundle.git src/OnePlusOne/OAuthBundle

  2. Add this bundle to your application's kernel:

     // application/AppKernel.php
     public function registerBundles()
     {
         return array(
             // ...
             new OnePlusOne\OAuthBundle\OAuthBundle(),
             // ...
         );
     }
    
  3. Add OnePlusOne and TwitterOAuth to the autoloader

     $loader->registerNamespaces(array(
       // ...
       'OnePlusOne'                     => __DIR__.'/../src',
       'TwitterOAuth'                   => __DIR__.'/../vendor/twitteroauth',
     ));
    
  4. Configure the oauth service in your config:

     # application/config/config.yml
     oauth.facebook:
       appId:  123
       secret: abc
     
       #optional
       req_perms: 'publish_stream'
     
     oauth.twitter:
       key: 123
       secret: abc
    
  5. Check if the PHP template engine is enabled

     # application/config/config.yml
     app.config:
       // ...
       templating:    { engines: ['php', 'twig'] }
    
  6. Load the routings in your routing.yml:

     OAuthBundle:
       resource: OAuthBundle/Resources/config/routing.yml
    

Usage

Go to http://localhost/login and choose your service and connect!

Enjoy

  • Ruud

oauthbundle's People

Contributors

drowe avatar ruudk avatar

Stargazers

 avatar

Watchers

 avatar  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.