suphiyasin / instagram-api

Simple PHP Private API that allows you to use both mobile and web APIs of Instagram
https://suphi.org
MIT License
30 stars 10 forks source link

Two Factor Login Not Workin #5

Closed NaveenNain1 closed 4 months ago

NaveenNain1 commented 5 months ago

I am using this code: I have to use 6-digit code: But gives an error in response: {"message":"This code is no longer valid. Please request a new code.","status":"fail","error_type":"invalid_nonce"}

PLEASE CHECK I THINK THERE IS PROBLEM IN FUNCTION
$api = new Instagram(); $username = 'mr_naveennain'; $password = 'Vikram!126116'; if(isset($_GET['factorcode'])){ $twofid = $_GET['twoid']; //1= Sms Verifivation || 2 = backup codes || 3 = Duo app code || 4= I guess its whatsapp $step3 = json_decode($api->login->twofactorv2($username, $twofid, $_GET["factorcode"], "3"), true); print_r($step3); if($step3["status"] == "ok"){ echo "login success"; }else{ echo "login fail"; } }else{ $step1 = json_decode($api->login->loginv2($username, $password), true); if($step1["Status"] == "ok"){ echo "already logged"; }else if($step1["Status"] == "fail" and isset($step1["TwoFactorId"])){ $twofid = $step1["TwoFactorId"]; print_r($step1); echo '

<input type="hidden" value="'.$step1["TwoFactorId"].'" name="twoid"/>
';

}else{ //somthing went wrong var_dump($step1); } }

NaveenNain1 commented 5 months ago

Please check, I think there is a problem in this library

suphiyasin commented 5 months ago

Hello, the code you sent does not submit anywhere.

suphiyasin commented 5 months ago

Also please change your password.

$username = 'mr_naveennain';
$password = 'Vikram!126116';
NaveenNain1 commented 5 months ago

Brother please check the lib with you Instagram id & Password with 2FA.

NaveenNain1 commented 4 months ago

can check