diff --git a/core/modules/rest/lib/Drupal/rest/EventSubscriber/RouteSubscriber.php b/core/modules/rest/lib/Drupal/rest/EventSubscriber/RouteSubscriber.php index 701d259..fde2679 100644 --- a/core/modules/rest/lib/Drupal/rest/EventSubscriber/RouteSubscriber.php +++ b/core/modules/rest/lib/Drupal/rest/EventSubscriber/RouteSubscriber.php @@ -73,8 +73,8 @@ public function dynamicRoutes(RouteBuildEvent $event) { continue; } // Check authentication. - if (is_array($enabled_methods[$method]['options']['_auth']) && !empty($enabled_methods[$method]['options']['_auth'])) { - $route->setOption('_auth', $enabled_methods[$method]['options']['_auth']); + if (is_array($enabled_methods[$method]['supported_auth']) && !empty($enabled_methods[$method]['supported_auth'])) { + $route->setOption('_auth', $enabled_methods[$method]['supported_auth']); } // If there is no format requirement or if it matches the // configuration also add the route. diff --git a/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php b/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php index d2afe66..3618931 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php @@ -92,4 +92,5 @@ protected function basicAuthGet($path, $username, $password) { return $out; } + } diff --git a/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php b/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php index 8290d8a..16dae4e 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php @@ -205,7 +205,7 @@ protected function enableService($resource_type, $method = 'GET', $format = NULL } } if (is_array($auth) && !empty($auth)) { - $settings[$resource_type][$method]['options']['_auth'] = $auth; + $settings[$resource_type][$method]['supported_auth'] = $auth; } $config->set('resources', $settings);