mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
30 lines
784 B
PHP
30 lines
784 B
PHP
<?php
|
|
|
|
namespace League\OAuth2\Server\ServiceProviders;
|
|
|
|
use League\Container\ServiceProvider;
|
|
use League\OAuth2\Server\Grant\ClientCredentialsGrant;
|
|
|
|
class ClientCredentialsGrantProvider 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;
|
|
});
|
|
}
|
|
}
|