/** * @param AuthorizationResponse $response * @return bool * @throws \LogicException */ public function validateResponse(AuthorizationResponse $response) { if (!$this->isInitiated()) { throw new \LogicException('State not initiated'); } if (empty($response->getParams()['state'])) { return false; } return $response->getParams()['state'] == $this->getState(); }