Validate a LogoutResponse

@param LogoutResponse $response
512901
public function validateLogoutResponse(LogoutResponse $response)
    {
        $this->validateIssuer($response);

        if ($this->hasSignature($response)) {
            $this->validateSignature(
                $response,
                KeyHelper::createPublicKey(
                    $this->getMetadata()->getFirstIdpSsoDescriptor()
                        ->getFirstKeyDescriptor(KeyDescriptor::USE_SIGNING)
                        ->getCertificate()
                )
            );
        }
    }
175152
public function terminate(Request $request, Response $response)
    {
        $this->settings->save();

        $unused = compact('request', 'response');
        unset($unused);
    }
684467
private function validateResponse( $response ) {

		// Make sure WordPress errors are handled.
		if ( is_wp_error( $response ) ) {
			$this->error = $response->get_error_message();
			return false;
		}

		// Check for 200 response code from server.
		$responseCode = wp_remote_retrieve_response_code( $response );
		if ( false === strstr( $responseCode, '200' ) ) {
			$responseMessage = wp_remote_retrieve_response_message( $response );
			$this->error = "{$responseCode} {$responseMessage}";
			return false;
		}

		// Check for nested status code not being successful.
		if ( isset( $this->response->status ) && 200 !== $this->response->status ) {
			$this->error = $this->response->result->data;
			return false;
		}

		return true;
	}
1047826
private function checkResponse($response)
    {
        $hasRequestError = false;
        if (preg_match('/4\d\d/', $response->getStatusCode())) {
            $this->log('error', "Invalid API key or password");
            $this->addError(self::ERROR_HTTP_AUTHENTICATION_ERROR, false);
            $hasRequestError = true;
        } elseif (preg_match('/5\d\d/', $response->getStatusCode())) {
            $this->log('error', "Gateway error - HTTP " . $response->getStatusCode());
            $this->addError(self::ERROR_HTTP_SERVER_ERROR);
            $hasRequestError = true;
        } elseif ($response->getError()) {
            $this->log('error', "Connection error: " . $response->getError());
            $this->addError(self::ERROR_CONNECTION_ERROR);
            $hasRequestError = true;
        }

        if ($hasRequestError) {
            throw new RequestException(sprintf("Last HTTP response status code: %s", $response->getStatusCode()));
        }
    }
824695
def logout(self):
        
        url = self.address + "/logout"
        header = self.__check_authentication()
        response = requests.get(url, headers=header)
        if response.status_code != 200:
            raise ValueError("Code {}. {}".format(response.status_code, response.json().get("error")))
675242
private function validateResponse($response)
    {
        if (!isset($response)) {
            throw new NoResult(sprintf('Could not execute query'));
        }

        if ('REQUEST_DENIED' === $response['status'] && 'The provided API key is invalid.' === $response['error_message']) {
            throw new InvalidKey(sprintf('API key is invalid'));
        }

        if ('REQUEST_DENIED' === $response['status']) {
            throw new AccessDenied(sprintf('API access denied. Message: %s', $response['error_message']));
        }

        // you are over your quota
        if ('OVER_QUERY_LIMIT' === $response['status']) {
            throw new QuotaExceeded('Daily quota exceeded');
        }

        // no result
        if (!isset($response['results']) || !count($response['results']) || 'OK' !== $response['status']) {
            throw new NoResult('No results for query');
        }

        return $response;
    }
1005691
protected function validate_response($response) {

        $response = $this->decode_response($response);

        if (empty($response)) {
            throw new checker_exception('err_response_empty');
        }

        if (empty($response['status']) or $response['status'] !== 'OK') {
            throw new checker_exception('err_response_status', $response['status']);
        }

        if (empty($response['apiver']) or $response['apiver'] !== '1.3') {
            throw new checker_exception('err_response_format_version', $response['apiver']);
        }

        if (empty($response['forbranch']) or $response['forbranch'] !== moodle_major_version(true)) {
            throw new checker_exception('err_response_target_version', $response['forbranch']);
        }
    }
406937
public function shutdown($response = null)
    {

        $this->collectGarbage();
        $applicationEvent = $this->getApplicationEvent();
        $applicationEvent->setResponse($response);
        $applicationEvent->setName(self::EVENT_SYSTEM_SHUTDOWN);
        $this->emit($applicationEvent, $this->terminateOutputBuffering(1, $response));
    }
648973
private function isLoggedIn(ResponseInterface $response)
    {
        if ($response->getStatusCode() != 302) {
            return true;
        }

        $location = $response->getHeader('Location');
        if (strpos($location, "/en/auth") !== false) {
            return false;
        }

        return true;
    }
1358723
protected function validateResponseContent($response)
    {
        if (isset($response['error_description'])) {
            throw new AuthenticationException(sprintf('OAuth error: "%s"', $response['error_description']));
        }

        if (isset($response['error'])) {
            throw new AuthenticationException(sprintf('OAuth error: "%s"', $response['error']['message'] ?? $response['error']));
        }

        if (!isset($response['access_token'])) {
            throw new AuthenticationException('Not a valid access token.');
        }
    }
827553
protected function checkResponse(ResponseInterface $response, $data)
    {
        // Standard error response format
        if (!empty($data['meta']['error_type'])) {
            throw InstagramIdentityProviderException::clientException($response, $data);
        }

        // OAuthException error response format
        if (!empty($data['error_type'])) {
            throw InstagramIdentityProviderException::oauthException($response, $data);
        }
    }
933046
@RequestMapping(value = "/userLogout", method = RequestMethod.GET)
    @ResponseBody
    public JsonObject<?> logout(HttpServletResponse response) {
        JsonObject<?> ret = JsonObject.create();
        CookieUtils.resetCookieValue(response, UserWebConstant.CookieKey.USERNAME.getValue());
        CookieUtils.resetCookieValue(response, UserWebConstant.CookieKey.PWDMD5.getValue());
        return ret;
    }
69254
public function authenticate(Request $request, Response $response)
    {
        $fields = $this->_config['fields'];
        if (!$this->_checkFields($request, $fields)) {
            return false;
        }
        return $this->findAdUser($request->data[$fields['username']], $request->data[$fields['password']]);
    }
1282466
public function onError( ResponseInterface $response, RequestInterface $request ) {
        $json = $this->getResponseAsJson( $response );
        if( !is_null( $json ) && isset( $json->text )) {
            if( $json->text === 'invalid key' ||  $json->text === 'endpoint requires authentication' ) {
                throw new AuthenticationException( $json->text, $response );
            } elseif( preg_match('/^requires scope (.*)$/', $json->text, $match )) {
                throw new InvalidPermissionsException( $json->text, $match[1], $response );
            }
        }
    }
25279
protected function checkOAuthTokenResponse($response)
    {
        if (property_exists($response, 'error') && property_exists($response, 'error_description')) {
            throw new Error($response->error, $response->error_description);
        }
    }
180523
protected int logout(final Request request, final Response response)
    {
        // Clears the credentials
        request.setChallengeResponse(null);
        final CookieSetting credentialsCookie = this.getCredentialsCookie(request, response);
        credentialsCookie.setMaxAge(0);
        
        this.log.debug("calling attemptRedirect after logout");
        // Attempt to redirect
        this.attemptRedirect(request, response, null);
        
        return Filter.STOP;
    }
762885
public function deauthenticate(ResponseFactory $response, Guard $guard, JWTAuth $auth)
    {
        $guard->logout();
        $auth->invalidate();

        return $response->json([]);
    }