You are here

protected function OAuth2ServerAuthentication::getResourcePluginIdFromRequest in RESTful 7.2

Get the resource plugin id requested.

Return value

null|string The plugin id of the resource that was requested.

1 call to OAuth2ServerAuthentication::getResourcePluginIdFromRequest()
OAuth2ServerAuthentication::getOAuth2Info in src/Plugin/authentication/OAuth2ServerAuthentication.php
Get OAuth2 information from the request.

File

src/Plugin/authentication/OAuth2ServerAuthentication.php, line 96

Class

OAuth2ServerAuthentication
Authentication support for oauth2_server.

Namespace

Drupal\restful\Plugin\authentication

Code

protected function getResourcePluginIdFromRequest() {
  $resource_name = $this->resourceManager
    ->getResourceIdFromRequest();
  $version = $this->resourceManager
    ->getVersionFromRequest();
  if (!$resource_name || !$version) {
    return NULL;
  }
  return $resource_name . PluginBase::DERIVATIVE_SEPARATOR . $version[0] . '.' . $version[1];
}