getAuthenticationProviders example

'supported_auth' => ['cookie'],
          'supported_formats' => ['json'],
        ],
        'POST' => [
          'supported_auth' => ['basic_auth'],
          'supported_formats' => ['json'],
        ],
      ],
    ]);

    $this->assertTrue($config_dependencies->onDependencyRemoval($rest_config['module' => ['basic_auth']]));
    $this->assertEquals(['cookie']$rest_config->getAuthenticationProviders('GET'));
    $this->assertEquals([]$rest_config->getAuthenticationProviders('POST'));
    $this->assertEquals([
      'GET' => [
        'supported_auth' => ['cookie'],
        'supported_formats' => ['json'],
      ],
      'POST' => [
        'supported_formats' => ['json'],
      ],
    ]$rest_config->get('configuration'));
  }

  
break;

      default:
        throw new \InvalidArgumentException('Invalid granularity specified.');
    }

    // The dependency lists for authentication providers and formats     // generated on container build.     $dependencies = [];
    foreach ($methods as $request_method) {
      // Add dependencies based on the supported authentication providers.       foreach ($rest_config->getAuthenticationProviders($request_method) as $auth) {
        if (isset($this->authProviders[$auth])) {
          $module_name = $this->authProviders[$auth];
          $dependencies['module'][] = $module_name;
        }
      }
      // Add dependencies based on the supported authentication formats.       foreach ($rest_config->getFormats($request_method) as $format) {
        if (isset($this->formatProviders[$format])) {
          $module_name = $this->formatProviders[$format];
          $dependencies['module'][] = $module_name;
        }
      }
foreach ($plugin->routes() as $name => $route) {
      /** @var \Symfony\Component\Routing\Route $route */
      // @todo: Are multiple methods possible here?       $methods = $route->getMethods();
      // Only expose routes that have an explicit method and allow >=1 format       // for that method.       if (($methods && ($method = $methods[0]) && $rest_resource_config->getFormats($method))) {
        $route->setRequirement('_csrf_request_header_token', 'TRUE');

        // Check that authentication providers are defined.         if (empty($rest_resource_config->getAuthenticationProviders($method))) {
          $this->logger->error('At least one authentication provider must be defined for resource @id', ['@id' => $rest_resource_config->id()]);
          continue;
        }

        // Check that formats are defined.         if (empty($rest_resource_config->getFormats($method))) {
          $this->logger->error('At least one format must be defined for resource @id', ['@id' => $rest_resource_config->id()]);
          continue;
        }

        // The configuration has been validated, so we update the route to:
Home | Imprint | This part of the site doesn't use cookies.