\OAuth2Scope

Summary

Methods
Properties
Constants
__construct()
checkScope()
scopeExists()
getScopeFromRequest()
getDefaultScope()
getReservedScopes()
No public properties found
No constants found
No protected methods found
$storage
N/A
No private methods found
No private properties found
N/A

Properties

$storage

$storage : 

Type

Methods

__construct()

__construct(mixed  $storage = null) 

Constructor

Parameters

mixed $storage
  • Either an array of supported scopes, or an instance of OAuth2\Storage\ScopeInterface

Throws

\InvalidArgumentException

checkScope()

checkScope(string  $required_scope, string  $available_scope) : boolean

Check if everything in required scope is contained in available scope.

Parameters

string $required_scope
  • A space-separated string of scopes.
string $available_scope
  • A space-separated string of scopes.

Returns

boolean —
  • TRUE if everything in required scope is contained in available scope and FALSE if it isn't.

scopeExists()

scopeExists(string  $scope) : boolean

Check if the provided scope exists in storage.

Parameters

string $scope
  • A space-separated string of scopes.

Returns

boolean —
  • TRUE if it exists, FALSE otherwise.

getScopeFromRequest()

getScopeFromRequest(\OAuth2\RequestInterface  $request) : string

Return scope info from request

Parameters

\OAuth2\RequestInterface $request
  • Request object to check

Returns

string

getDefaultScope()

getDefaultScope(null  $client_id = null) : mixed

Parameters

null $client_id

Returns

mixed

getReservedScopes()

getReservedScopes() : array

Get reserved scopes needed by the server.

In case OpenID Connect is used, these scopes must include: 'openid', offline_access'.

Returns

array —
  • An array of reserved scopes.