Request access token and public token

askshripad
Hi,

I am using Javascript API to connect to kite.
First I created kiteconnect object as below:
var kc = new KiteConnect(api_key, api_secret);
Then I got the login url using kc.loginUrl().
Bu when I browse this URL, it connectes to my zerodha account and I did not get request token in browser link or anywhere.
Also, how to get public token.

Please let me know if I am missing anything.

Thanks,
Shripad


  • sujith
    sujith edited November 2017
    You can check out webinar and refer to documentation to know more about login flow.
  • askshripad
    Hi,

    Thanks for quick reply but I already gone through the video.
    From KiteConnect, I got the Login Url (https://kite.trade/connect/login?api_key=XXX).
    So as per the video, to get the request access token I copied above login url into browser.
    It is expected that I will get the request access token but I did not get it.
    Is it that I need to use python and not the Javascript.
    Note : I have opened developer account yesterday evening.

    Please let me know if you need any more details.

    Best Regards,
    Shripad
  • sujith
    Hi,
    It has nothing to do with any Kite Connect client. You can use any Kite Connect client. Did you log in after entering login URL in the browser?
    Can you private message the URL after logging in?
  • askshripad
    Hi Sujith,

    Yes,I logged in but it opened the Zerodha dashboard.
    I followed below steps:
    1. Get login URL using Kiteconnect object (PFA image "step1.png" for it)
    2. I answered the security questions and then it navigated to Zerodha dashboard (see dashboard.png)
    Actully it should show request access token in bavigation bar right.
    Please check and let me know if I am missing anything.

    Note : In the Apps, it is showing that it is connected to my created app. but did not see any request token (see apps.png)


    If required, let me know I can pass you the api key.

    Thanks,
    Shripad
  • sujith
    It seems like your session is expired. You just need to enter credentials and then log in then you will get request token in the URL.
  • askshripad
    Hi Sujith,

    session is not expired. In fact, I am creating the object on startup. So unless and untill I did not stop the client,it will be there.
    I have created the video and copied at below location
    https://drive.google.com/open?id=1dksjil2fYxWI__FzBkSM1490PhXPeFXB

    Please check and let me know what I need to do.

    Thanks,
    Shripad
  • sujith
    Use some other URL like localhost or something. If you use kite.zerodha.com then it will redirect to Kite landing page.
  • askshripad
    Hi Sujith,

    Thank you very much. Finally it is working :)

    Regards,
    Shripad
This discussion has been closed.