for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2018 Spomky-Labs
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace OAuth2Framework\Bundle\DependencyInjection\Component\Grant\ClientCredentials;
use OAuth2Framework\Bundle\DependencyInjection\Component\Component;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
final class ClientCredentialsSource implements Component
{
/**
* {@inheritdoc}
public function name(): string
return 'client_credentials';
}
public function load(array $configs, ContainerBuilder $container)
if ($configs['grant']['client_credentials']['enabled']) {
$container->setParameter('oauth2_server.grant.client_credentials.issue_refresh_token', $configs['grant']['client_credentials']['issue_refresh_token']);
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../../../Resources/config/grant'));
$loader->load('client_credentials.php');
public function getNodeDefinition(NodeDefinition $node)
$node->children()
->arrayNode('client_credentials')
->canBeEnabled()
->children()
->booleanNode('issue_refresh_token')
->info('If enabled, a refresh token will be issued with an access token (not recommended)')
->defaultFalse()
->end()
->end();
public function prepend(ContainerBuilder $container, array $config): array
//Nothing to do
return [];