/** * @param AuthorizationResponse $authResponse * @throws StateMismatchException */ public function handleAuthorizationResponse(AuthorizationResponse $authResponse) { if (!$this->stateStore->validateResponse($authResponse)) { throw new StateMismatchException('State does not match'); } $tokenRequest = new TokenRequest($this->clientConfig, $this->serverConfig, $this->httpClient, $authResponse); $tokenResponse = $tokenRequest->send(); $this->tokenStore->updateFromTokenResponse($tokenResponse); }
public function testValidateResponseWhereNotInitialized() { $response = $this->getAuthorizationResponse('ABC123'); $this->setExpectedException('\\LogicException'); $this->stateStore->validateResponse($response); }