Authentication failed: Invalid `checksum`.

sachinstlko09
Hi,
Using kiteconnect Version 3.0.2b php class file; Access token is not generated. When I checked it throws error of Authentication failed: Invalid `checksum` while calling generateSession function.
$requestToken and $api_secret key is correctly passed.

public function generateSession($request_token, $api_secret) {
$checksum = hash("sha256", $this->api_key.$request_token.$api_secret);

$resp = $this->_post("api.token", array(
"api_key" => $this->api_key,
"request_token" => $request_token,
"checksum" => $checksum
));

if($resp->access_token) {
$this->setAccessToken($resp->access_token);
}

if($resp->login_time) {
$resp->login_time = new DateTime($resp->login_time, new DateTimeZone("Asia/Kolkata"));
}

return $resp;
}

The code was working fine before.
Sign In or Register to comment.