Пытаюсь сделать вход в личный кабинет beeline kz, вообще застрял. Почему-то не идут редиректы, хотя они вроде как разрешены.
$client = new Client([
'base_uri' => 'https://my.beeline.kz/',
'cookie' => true,
'verify' => false,
'allow_redirects' => ['track_redirects' => true]
]);
$cookieJar = new CookieJar();
$response = $client->get('login.xhtml', [
'cookie' => true,
'cookies' => $cookieJar,
]);
$response = $client->request('POST', 'login.xhtml', [
'form_params' => [
'loginFormB2C:loginForm' => 'loginFormB2C:loginForm',
'loginFormB2C:loginForm:login' => $login,
'hiddenpwd' => $password,
'loginFormB2C:loginForm:passwordPwd' => '',
'loginFormB2C:loginForm:password' => $password,
'loginFormB2C:loginForm:j_idt74_input' => 'on',
'loginFormB2C:loginForm:loginButton ' => '',
'javax.faces.ViewState' => 'stateless'
],
'headers' => [
'Accept' => 'text/html,application/xhtml+xm…ml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Encoding' => 'gzip, deflate, br',
'Accept-Language' => 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
'Connection' => 'keep-alive',
'Content-Length' => '315',
'Host' => 'my.beeline.kz',
'Origin' => 'https://my.beeline.kz',
'Referer' => 'https://my.beeline.kz/login.xhtml',
'Content-Type' => 'application/x-www-form-urlencoded',
'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0',
'Upgrade-Insecure-Requests' => '1',
],
'cookies' => $cookieJar,
//'debug' => true,
'on_stats'=>function (TransferStats $stats){
echo $stats->getEffectiveUri()."\n";
},
]);
$headersRedirect = $response->getHeader(RedirectMiddleware::HISTORY_HEADER);
dd($headersRedirect);