Session Error

kartik.trade
After Successful Login, I am able to get access_token.

But When I write following Code :
include("kiteconnect.php");
$API_KEY = "xxxxxxxxx";
$access_token=$_GET['at'];
$kite = new KiteConnect($API_KEY,$access_token);
echo "Positions: \n";
print_r($kite->positions());

I got error : Authentication failed: Invalid session credentials
Fatal error: Uncaught TokenException (403) 'Invalid session credentials' thrown

Please Guide Me.
  • kartik.trade
    Also Note that my access_token is correct, and i am using same Access_Token for WebSocket Live Data Streaming successfully.
  • Vivek
    Vivek edited August 2016
    @kartik.trade Currently we have disabled authentication for websocket so you can't confirm whether the access_token is valid. Can you please try getting access token again and check? also I just want to confirm that you are exchanging request_token you get after login with access_token as given here?
  • kartik.trade
    Yes I am doing that.
    <?php
    // Compute the SHA-256 checksum.

    $api_key = "xxxx";
    $api_secret = "yyyy";

    // Incoming request token from the redirect.
    $request_token = $_GET["request_token"];

    $checksum = hash("sha256", $api_key . $request_token . $api_secret);
    ?>
    Please Help me.
    I also e-mail you my code file. @vivek
Sign In or Register to comment.