You are here

public function ScopeUtility::getScopeFromRequest in OAuth2 Server 8

Same name and namespace in other branches
  1. 2.0.x src/ScopeUtility.php \Drupal\oauth2_server\ScopeUtility::getScopeFromRequest()

Get scope from request.

Parameters

\Oauth2\RequestInterface $request: The request object.

Return value

string The scope string.

File

src/ScopeUtility.php, line 106

Class

ScopeUtility
Provides a scope-checking utility to the library.

Namespace

Drupal\oauth2_server

Code

public function getScopeFromRequest(RequestInterface $request) {

  // "scope" is valid if passed in either POST or QUERY.
  return $request
    ->request('scope', $request
    ->query('scope'));
}