Invalid Checksum issue

bkantikiran
Team

I am receiving the below error when I try to generate a session. Could you please guide?

Authentication failed: Invalid `checksum`.
Fatal error: Uncaught KiteConnect\Exception\TokenException (403) 'Invalid `checksum`.' thrown in /path/KiteConnect.php on line 1652.

Below is the snippet of my code:

require_once '../vendor/autoload.php';
use KiteConnect\KiteConnect;

$request_token = $_GET['request_token'];

//echo $request_token."";

// Initialise.
$kite = new KiteConnect($api_key);

// Assuming you have obtained the `request_token`
// after the auth flow redirect by redirecting the
// user to $kite->login_url()
try {
$user = $kite->generateSession($request_token, $api_secret);
echo "Authentication successful. \n";
print_r($user);
$kite->setAccessToken($user->access_token);
} catch(Exception $e) {
echo "Authentication failed: ".$e->getMessage();
throw $e;
}

echo $user->user_id." has logged in";
  • rakeshr
    Are you using the correct request_token, API key, and secret key, you need to verify the same. This thread explains more about the flow.
  • bkantikiran
    Thank you @rakeshr . You can close this thread. The issue was an incorrect api_secret.
This discussion has been closed.