Last active
September 6, 2015 12:17
-
-
Save jeffsrepoaccount/bd395ab49972bd884071 to your computer and use it in GitHub Desktop.
Service Provider for Resource Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Oauth2; | |
use Illuminate\Support\ServiceProvider; | |
use League\OAuth2\Server\ResourceServer; | |
class Oauth2ServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Bootstrap application services. | |
* | |
* @return void | |
*/ | |
public function boot() | |
{ | |
// | |
} | |
/** | |
* Registers a binding for the Resource Server. | |
* | |
* @return void | |
*/ | |
public function register() | |
{ | |
// | |
$app = $this->app; | |
$app->bind('League\OAuth2\Server\ResourceServer', function() use($app) { | |
$server = new ResourceServer( | |
$app->make('App\Oauth2\Storage\FluentSession'), | |
$app->make('App\Oauth2\Storage\FluentAccessToken'), | |
$app->make('App\Oauth2\Storage\FluentClient'), | |
$app->make('App\Oauth2\Storage\FluentScope') | |
); | |
return $server; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment