PHPackages                             notwin/oauth-4-laravel - 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. notwin/oauth-4-laravel

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

notwin/oauth-4-laravel
======================

OAuth Service Provider for Laravel 4

1.0.5(11y ago)0127MITPHPPHP &gt;=5.3

Since Sep 18Pushed 11y ago1 watchersCompare

[ Source](https://github.com/notwin/oauth-4-laravel)[ Packagist](https://packagist.org/packages/notwin/oauth-4-laravel)[ Docs](https://github.com/artdarek/oauth-4-laravel)[ RSS](/packages/notwin-oauth-4-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

OAuth wrapper for Laravel 4
===========================

[](#oauth-wrapper-for-laravel-4)

oauth-4-laravel is a simple laravel 4 service provider (wrapper) for [Lusitanian/PHPoAuthLib](https://github.com/Lusitanian/PHPoAuthLib)which provides oAuth support in PHP 5.3+ and is very easy to integrate with any project which requires an oAuth client.

---

- [Supported services](#supported-services)
- [Installation](#installation)
- [Registering the Package](#registering-the-package)
- [Configuration](#configuration)
- [Usage](#usage)
- [Basic usage](#basic-usage)
- [More usage examples](#more-usage-examples)

Supported services
------------------

[](#supported-services)

The library supports both oAuth 1.x and oAuth 2.0 compliant services. A list of currently implemented services can be found below. More services will be implemented soon.

Included service implementations:

- OAuth1
    - BitBucket
    - Etsy
    - FitBit
    - Flickr
    - Scoop.it!
    - Tumblr
    - Twitter
    - Xing
    - Yahoo
- OAuth2
    - Amazon
    - BitLy
    - Box
    - Dailymotion
    - Dropbox
    - Facebook
    - Foursquare
    - GitHub
    - Google
    - Harvest
    - Heroku
    - Instagram
    - LinkedIn
    - Mailchimp
    - Microsoft
    - PayPal
    - Pocket
    - Reddit
    - RunKeeper
    - SoundCloud
    - Vkontakte
    - Yammer
- more to come!

To learn more about Lusitanian/PHPoAuthLib go [here](https://github.com/Lusitanian/PHPoAuthLib)

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

[](#installation)

Add oauth-4-laravel to your composer.json file:

```
"require": {
  "artdarek/oauth-4-laravel": "dev-master"
}

```

Use composer to install this package.

```
$ composer update

```

### Registering the Package

[](#registering-the-package)

Register the service provider within the `providers` array found in `app/config/app.php`:

```
'providers' => array(
	// ...

	'Artdarek\OAuth\OAuthServiceProvider'
)
```

Add an alias within the `aliases` array found in `app/config/app.php`:

```
'aliases' => array(
	// ...

	'OAuth' => 'Artdarek\OAuth\Facade\OAuth',
)
```

Configuration
-------------

[](#configuration)

There are two ways to configure oauth-4-laravel. You can choose the most convenient way for you. You can use package config file which can be generated through command line by artisan (option 1) or you can simply create a config file called `oauth-4-laravel.php` in your `app\config\` directory (option 2).

#### Option 1

[](#option-1)

Create configuration file for package using artisan command

```
$ php artisan config:publish artdarek/oauth-4-laravel

```

#### Option 2

[](#option-2)

Create configuration file manually in config directory `app/config/oauth-4-laravel.php` and put there code from below.

```
