src/Auth/LeadpagesLogin.php
public function getUser($username, $password)
    {
        $authHash = $this->hashUserNameAndPassword($username, $password);
        $body     = json_encode(['clientType' => 'wp-plugin']);

        try {
            $response = $this->client->post(
              $this->loginurl, [
                'headers' => ['Authorization' => 'Basic ' . $authHash],
                'verify'  => $this->certFile,
                'body'    => $body //wp-plugin value makes session not expire
              ]);
            $this->response = $response->getBody();

        } catch (ClientException $e) {
            $response       = [
              'code'     => $e->getCode(),
              'response' => $e->getMessage(),
              'error'    => true
            ];
            $this->response = json_encode($response);

        } catch (ConnectException $e) {
            $message = 'Can not connect to Leadpages Server:';
            $response = $this->parseException($e, $message);
            $this->response = $response;
        }

        return $this;
    }
public function getUser($username, $password)
    {
        $authHash = $this->hashUserNameAndPassword($username, $password);
        $body     = json_encode(['clientType' => 'wp-plugin']);

        try {
            $response = $this->client->post(
              $this->loginurl, [
                'headers' => ['Authorization' => 'Basic ' . $authHash],
                'verify'  => $this->certFile,
                'body'    => $body //wp-plugin value makes session not expire
              ]);
            $this->response = $response->getBody();

        } catch (ClientException $e) {
            $response       = [
              'code'     => $e->getCode(),
              'response' => $e->getMessage(),
              'error'    => true
            ];
            $this->response = json_encode($response);

        } catch (ConnectException $e) {
            $message = 'Can not connect to Leadpages Server:';
            $response = $this->parseException($e, $message);
            $this->response = $response;
        }

        return $this;
    }
public function getUser ( $ username , $ password ) { $ authHash = $ this -> hashUserNameAndPassword ( $ username , $ password ) ; $ body = json_encode ( [ 'clientType' => 'wp-plugin' ] ) ; try { $ response = $ this -> client -> post ( $ this -> loginurl , [ 'headers' => [ 'Authorization' => 'Basic ' . $ authHash ] , 'verify' => $ this -> certFile , 'body' => $ body //wp-plugin value makes session not expire ] ) ; $ this -> response = $ response -> getBody ( ) ; } catch ( ClientException $ e ) { $ response = [ 'code' => $ e -> getCode ( ) , 'response' => $ e -> getMessage ( ) , 'error' => true ] ; $ this -> response = json_encode ( $ response ) ; } catch ( ConnectException $ e ) { $ message = 'Can not connect to Leadpages Server:' ; $ response = $ this -> parseException ( $ e , $ message ) ; $ this -> response = $ response ; } return $ this ; }
get user information

@param string $username
@param string $password

@return array|\GuzzleHttp\Message\FutureResponse|\GuzzleHttp\Message\ResponseInterface|\GuzzleHttp\Ring\Future\FutureInterface|null
get user information