From 96c44744f33c452a0b0fd2ab95208d56fa730e95 Mon Sep 17 00:00:00 2001 From: ldaspt <72605285+ldaspt@users.noreply.github.com> Date: Fri, 9 Feb 2024 17:04:51 +0100 Subject: [PATCH] Allow "use_authorization_to_get_token" to be configured to false for generic OAuth2 (#1974) * Allow "use_authorization_to_get_token" to be configured to false for generic OAuth2 Backport of the fix https://github.com/hwi/HWIOAuthBundle/pull/1879 for branch 2.0 * Fix phpcsfixer --- src/DependencyInjection/Configuration.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index ea8c79c35..dea103330 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -227,7 +227,13 @@ private function addResourceOwnersConfiguration(ArrayNodeDefinition $node): void ->end() ->scalarNode('use_authorization_to_get_token') ->validate() - ->ifEmpty() + ->ifTrue(function ($v) { + if (false === $v) { + return false; + } + + return empty($v); + }) ->thenUnset() ->end() ->end()