mirror of
				https://github.com/elyby/oauth2-server.git
				synced 2025-05-31 14:12:07 +05:30 
			
		
		
		
	Added ClientCredentialsGrantServerProvider
This commit is contained in:
		| @@ -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; | ||||
|         }); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user