OPTIONAL.  A space-separated list of strings representing the
scopes associated with this token, in the format described in
Section 3.3 of OAuth 2.0 [RFC6749].

@return fkooman\OAuth\Common\Scope
493074
public function getScope()
    {
        $scopeValue = $this->getKeyValue('scope');
        if (false === $scopeValue) {
            return new Scope();
        }

        return Scope::fromString($scopeValue);
    }
1102873
def has_scope(self, scope):
        """"""
        if not self.is_oauth_session():
            return False
        if '*' in self._authentication:
            return True
        if isinstance(scope, six.string_types):
            scope = [scope]
        return all(s in self._authentication for s in scope)
539258
public function to_string(): string
	{
		return 'oauth_token=' .
			Util::urlencode_rfc3986($this->key) .
			'&oauth_token_secret=' .
			Util::urlencode_rfc3986($this->secret);
	}
1279220
public function getScopes()
    {
        if (!isset($this->_scopes)) {
            $this->_scopes = clone $this->getService('com:components.domain.entityset.scope');
        }

        return $this->_scopes;
    }
163723
public function parseSymbol()
    {
        $token = $this->str[$this->last];
        if (! ($flags = Context::isSymbol($token))) {
            return null;
        }

        if ($flags & Token::FLAG_SYMBOL_VARIABLE) {
            if ($this->last + 1 < $this->len && $this->str[++$this->last] === '@') {
                // This is a system variable (e.g. `@@hostname`).
                $token .= $this->str[$this->last++];
                $flags |= Token::FLAG_SYMBOL_SYSTEM;
            }
        } elseif ($flags & Token::FLAG_SYMBOL_PARAMETER) {
            if ($this->last + 1 < $this->len) {
                ++$this->last;
            }
        } else {
            $token = '';
        }

        $str = null;

        if ($this->last < $this->len) {
            if (($str = $this->parseString('`')) === null) {
                if (($str = $this->parseUnknown()) === null) {
                    $this->error(
                        'Variable name was expected.',
                        $this->str[$this->last],
                        $this->last
                    );
                }
            }
        }

        if ($str !== null) {
            $token .= $str->token;
        }

        return new Token($token, Token::TYPE_SYMBOL, $flags);
    }
561245
public function getAccessToken() {
    $token = self::$auth->getAccessToken();
    return (null == $token || 'null' == $token) ? null : $token;
  }
496820
public function peek()
    {
        if (isset($this->tokens[$this->current + ++$this->peek])) {
            return $this->tokens[$this->current + $this->peek];
        } else {
            return null;
        }
    }
284985
public static function scopes()
    {
        return collect(static::$scopes)->map(function ($description, $id) {
            return new Scope($id, $description);
        })->values();
    }
885121
public function getScopes(SessionEntity $session)
    {
        // TODO: Check this before pushing
        $result = $this->getConnection()->table('oauth_session_scopes')
                  ->select('oauth_scopes.*')
                  ->join('oauth_scopes', 'oauth_session_scopes.scope_id', '=', 'oauth_scopes.id')
                  ->where('oauth_session_scopes.session_id', $session->getId())
                  ->get();

        $scopes = [];

        foreach ($result as $scope) {
            $scopes[] = (new ScopeEntity($this->getServer()))->hydrate([
                'id' => $scope->id,
                'description' => $scope->description,
            ]);
        }

        return $scopes;
    }
148353
public function getRequirementStrings()
    {
        $map = $this->translatable_requirements;
        foreach ($map as $key => &$value) {
            if ($value instanceof Closure) {
                $value = $value($this, $key);
            }
        }

        return $map;
    }
1241854
private function parseToken()
    {
        $token = '';

        while ($this->valid()) {
            if (ctype_space($this->current)) {
                // Skip space
                $this->next();

                break;
            }

            if ('\\' === $this->current) {
                $token .= $this->parseEscapeSequence();
            } elseif ("'" === $this->current || '"' === $this->current) {
                $token .= $this->parseQuotedString();
            } else {
                $token .= $this->current;
                $this->next();
            }
        }

        return $token;
    }
324475
def require_scopes(self, scope_string):
        
        scopes = _process_scopes(scope_string)
        if not scopes:
            # asking for tokens with no scopes
            return self.filter(scopes__isnull=True)
        from .models import Scope
        scope_pks = Scope.objects.filter(name__in=scopes).values_list('pk', flat=True)
        if not len(scopes) == len(scope_pks):
            # there's a scope we don't recognize, so we can't have any tokens for it
            return self.none()
        tokens = self.all()
        for pk in scope_pks:
            tokens = tokens.filter(scopes__pk=pk)
        return tokens
620915
public function getScopes()
    {
        if ($this->scopes === null) {
            $this->scopes = $this->formatScopes($this->server->getSessionStorage()->getScopes($this));
        }

        return $this->scopes;
    }
1219249
public function getScope()
    {
        $scope = $this->getData('scope');

        if ($scope === null) {
            $scope = ContainerScopeInterface::SCOPE_DEFAULT;

            if ($this->getContainerCode()) {
                $scope = ContainerScopeInterface::SCOPE_CONTAINERS;
            }
            if ($this->getStoreCode()) {
                $scope = ContainerScopeInterface::SCOPE_STORE_CONTAINERS;
            }

            $this->setScope($scope);
        }

        return $scope;
    }
854434
protected function hasNecessaryVerifier()
    {
        $query = $this->request->getQueryParams();
        $hasToken = A::get($query, 'oauth_token') !== null;
        $hasVerifier = A::get($query, 'oauth_verifier') !== null;

        return $hasToken && $hasVerifier;
    }
933184
public function getDefaultScopes()
    {
        $scopes = $this->configService->getValue('scopes_default');

        return array_filter(array_map('trim', Service\Scope::split($scopes)), function ($scope) {
            // we filter out the backend scope since this would be a major
            // security issue
            return !empty($scope) && $scope != 'backend';
        });
    }
1038831
protected function _parseArgs()
    {
        $inString = false;
        $cpt = 0;
        $last = $char = $value = $name = '';
        $args = [];
        $body = '';
        while ($token = $this->_stream->current(true)) {
            $body .= $token[1];
            switch ($token[0]) {
                case '(':
                    if ($cpt) {
                        $value .= $token[1];
                    }
                    $cpt++;
                break;
                case '=':
                    $name = $value;
                    $value = '';
                break;
                case ')':
                    $cpt--;
                    if ($cpt) {
                        $value .= $token[1];
                        break;
                    }
                case ',':
                    $value = trim($value);
                    if ($value !== '') {
                        $name ? $args[trim($name)] = $value : $args[] = $value;
                    }
                    $name = $value = '';
                break;
                default:
                    $value .= $token[1];
                break;
            }
            if ($token[1] === ')' && $cpt === 0) {
                break;
            }
            $this->_stream->next();
        }
        return compact('args', 'body');
    }