mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-02 19:51:03 +05:30
Added ClientCredentialsGrantServerProvider
This commit is contained in:
parent
f964fd2962
commit
f1da0d2943
@ -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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user