getHeaders()->get('Authorization'); if ($authHeader !== null && preg_match('/^' . $this->header . '\s+(.*?):(.*?)$/', $authHeader, $matches)) { $identity = $user->loginByAccessToken($matches[1].':'.$matches[2], get_class($this)); if ($identity === null) { $this->handleFailure($response); } return $identity; } return null; } /** * @inheritdoc */ public function challenge($response) { $response->getHeaders()->set('WWW-Authenticate', "Bearer realm=\"{$this->realm}\""); } }