hannesvdvreken / oauth
Laravel OAuth IoC wrapper Library
Installs: 1 988
Dependents: 0
Suggesters: 0
Security: 0
Stars: 23
Watchers: 3
Forks: 2
Open Issues: 0
Requires
- php: >=5.3
- lusitanian/oauth: *
Requires (Dev)
- illuminate/session: 4.1.*
- illuminate/support: 4.1.*
- mockery/mockery: 0.8.*
This package is auto-updated.
Last update: 2022-02-01 12:34:33 UTC
README
Suggestion: This is just a Service Provider with a Laravel Session class for token storage. If you would like to keep using Lusitanian's PHPoAuthLib, please use artdarek/oauth-4-laravel
by Dariusz Prząda. If you are interested in Guzzle-based service classes, look here!
Usage
Follow the steps below and you will be able to get an object of the service class with one rule:
$fb = OAuth::consumer('Facebook'); $fb = OAuth::consumer('Facebook', 'https://example.com/callback');
Optionally, add a second parameter with the URL which the service needs to redirect to. Default, it uses the URL::current()
, provided by Laravel (L4).
How to integrate
Alias
Add an alias to the bottom of app/config/app.php
'OAuth' => 'hannesvdvreken\OAuth\facade\OAuth',
and register this service provider at the bottom of the providers
array:
'providers' => array( ... 'hannesvdvreken\OAuth\OAuthServiceProvider', ),
Credentials
Add your credentials to app/config/oauth.php
return array( /** * One of 'StreamClient' or 'CurlClient'. Defaults to 'StreamClient' if not provided. */ 'client' => 'StreamClient', 'consumers' => array( 'Facebook' => array( 'client_id' => '', 'client_secret' => '', 'scope' => array(), ), ), );