PHPackages                             gigablah/silex-oauth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. gigablah/silex-oauth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

gigablah/silex-oauth
====================

Silex OAuth Authentication Provider

1.3.1(10y ago)10846.1k↓15%24[5 issues](https://github.com/gigablah/silex-oauth/issues)[2 PRs](https://github.com/gigablah/silex-oauth/pulls)1MITPHP

Since Oct 5Pushed 6y ago4 watchersCompare

[ Source](https://github.com/gigablah/silex-oauth)[ Packagist](https://packagist.org/packages/gigablah/silex-oauth)[ Docs](https://github.com/gigablah/silex-oauth)[ RSS](/packages/gigablah-silex-oauth/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (12)Used By (1)

OAuthServiceProvider
====================

[](#oauthserviceprovider)

The OAuthServiceProvider integrates the [lusitanian/oauth](https://github.com/Lusitanian/PHPoAuthLib) library with the [Security](http://silex.sensiolabs.org/doc/providers/security.html) component to provide social logins for the [Silex](http://silex.sensiolabs.org) microframework.

This library only provides the authentication system. You would have to supply your own user provider, or you can make use of the in-memory provider for testing.

Features
--------

[](#features)

- Supports most popular providers such as Facebook, Twitter, Google and GitHub
- Extensible via event hooks so you can plug in your own listeners and user providers
- Supports optional CSRF protection mechanism

Example
-------

[](#example)

Check out the [demo application](https://github.com/gigablah/silex-oauth-demo/blob/master/public/index.php) for a code example.

Installation
------------

[](#installation)

Use [Composer](http://getcomposer.org) to install the gigablah/silex-oauth library by adding it to your `composer.json`.

You should use a version that is compatible with your Silex installation.

Take note that the versions specified for `symfony/security` (or any other Symfony component) in the examples below are based on compatibility with *Silex*. OAuthServiceProvider itself should be compatible with component versions from 2.3.0 onwards (please open an issue if this is not the case).

### Silex 2.0

[](#silex-20)

```
{
    "require": {
        "silex/silex": "~2.0@dev",
        "symfony/security": "~2.7,=1.0
