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";
This discussion has been closed.