src/CasRestClient.php
private function getServiceTicket($service)
    {


        try {
            $response = $this->guzzleClient->request(
                'POST',
                $this->tgtLocation,
                [
                    'verify' => $this->verifySSL,
                    'form_params' => [
                        'service' => $service
                    ]
                ]
            );
            return (string) $response->getBody();
        } catch (ClientException $e) {
            // Bad TGT - login again
            if ($e->getCode() == 404) {
                // Force authentication and save the TGT
                $this->login($this->tgtStorageLocation, true);
                return $this->getServiceTicket($service);
                // Unsupported Media Type
            } elseif ($e->getCode() == 415) {
                return false;
            } else {
                throw new \Exception($e->getMessage(), $e->getCode());
            }
        } catch (\Exception $e) {
            throw new \Exception($e->getMessage(), $e->getCode());
        }
    }
private function getServiceTicket($service)
    {


        try {
            $response = $this->guzzleClient->request(
                'POST',
                $this->tgtLocation,
                [
                    'verify' => $this->verifySSL,
                    'form_params' => [
                        'service' => $service
                    ]
                ]
            );
            return (string) $response->getBody();
        } catch (ClientException $e) {
            // Bad TGT - login again
            if ($e->getCode() == 404) {
                // Force authentication and save the TGT
                $this->login($this->tgtStorageLocation, true);
                return $this->getServiceTicket($service);
                // Unsupported Media Type
            } elseif ($e->getCode() == 415) {
                return false;
            } else {
                throw new \Exception($e->getMessage(), $e->getCode());
            }
        } catch (\Exception $e) {
            throw new \Exception($e->getMessage(), $e->getCode());
        }
    }
private function getServiceTicket ( $ service ) { try { $ response = $ this -> guzzleClient -> request ( 'POST' , $ this -> tgtLocation , [ 'verify' => $ this -> verifySSL , 'form_params' => [ 'service' => $ service ] ] ) ; return ( string ) $ response -> getBody ( ) ; } catch ( ClientException $ e ) { // Bad TGT - login again if ( $ e -> getCode ( ) == 404 ) { // Force authentication and save the TGT $ this -> login ( $ this -> tgtStorageLocation , true ) ; return $ this -> getServiceTicket ( $ service ) ; // Unsupported Media Type } elseif ( $ e -> getCode ( ) == 415 ) { return false ; } else { throw new \ Exception ( $ e -> getMessage ( ) , $ e -> getCode ( ) ) ; } } catch ( \ Exception $ e ) { throw new \ Exception ( $ e -> getMessage ( ) , $ e -> getCode ( ) ) ; } }
Request Service ticket from CAS server

@param $service
@return bool|\GuzzleHttp\Stream\StreamInterface|null
@throws \Exception
Request Service ticket from CAS server