You are here

function oauth2_server_verify_access in OAuth2 Server 7

Verifies access for the passed server and scope.

Parameters

$server_name: The name of the server for which access should be verified.

$scope: An optional string of space-separated scopes to check.

Return value

array A valid access token if found. If the access check fails, execution is aborted and an error response is sent to the user.

See also

oauth2_server_check_access()

1 call to oauth2_server_verify_access()
oauth2_server_test_resource in tests/oauth2_server_test.module
Page callback: Provides access checking for an imaginary resource.

File

./oauth2_server.module, line 1100
Provides OAuth2 server functionality.

Code

function oauth2_server_verify_access($server_name, $scope = NULL) {
  $result = oauth2_server_check_access($server_name, $scope);
  if ($result instanceof \OAuth2\Response) {
    oauth2_server_send_response($result);
  }
  return $result;
}