I'm trying to login into shopify account using curl by posting username and password credentials. here's my code.
$username = "someEmail";
$password = "somePassword";
$url="https://******.myshopify.com/admin/auth/login";
$cookie_file_path ="cookie.txt";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($ch, CURLOPT_USERAGENT,
"Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, $_SERVER['REQUEST_URI']);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'login='.$username.'&password='.$password);
print_r(curl_exec($ch));
$info = curl_getinfo($ch);
print_r($info);
curl_close($ch);
Currently when i execute this, no login is happening, instead it is showing "You have been redirected", and when clicked on that link it'll go to the login page of shopify.