Added ClientCredentialsGrantServerProvider

This commit is contained in:
Alex Bilbie 2015-04-05 17:01:41 +01:00
parent f964fd2962
commit f1da0d2943

View File

@ -0,0 +1,29 @@
<?php
namespace League\OAuth2\Server\ServiceProviders;
use League\Container\ServiceProvider;
use League\OAuth2\Server\Grant\ClientCredentialsGrant;
class ClientCredentialsGrantServerProvider extends ServiceProvider
{
protected $provides = ['ClientCredentialsGrant'];
/**
* @inheritdoc
*/
public function register()
{
$container = $this->getContainer();
$container->add('ClientCredentialsGrant', function () use ($container) {
$grant = new ClientCredentialsGrant(
$container->get('emitter'),
$container->get('ClientRepository'),
$container->get('ScopeRepository'),
$container->get('AccessTokenRepository')
);
return $grant;
});
}
}