Simple ASP.NET page which will login to Kite

pawandev
Hello,

Can anybody create a simple asp.net(webform) page which can do basic functionality like logging and placing a simple order.

Thanks
Pawan
  • joy
    joy edited February 2017
    Heres a walkthrough for a basic login

    Create 2 aspx page, say Kite.aspx and Redirect.aspx where Kite.aspx is where you will do the login and the Redirect.aspx is where you will be redirected to.

    Login to your Kite developer account > Click on the app > append the redirect url (https://www.yoursite.com/Redirect.aspx).
    Note: to test it locally append something like http://localhost:{port}/Redirect.aspx, where {port} equals the actual port. For example http://localhost:56005/Redirect.aspx

    In the Kite.aspx code behind append the following code
    private const string apiKey = "your api key";

    protected void Page_Load(object sender, EventArgs e)
    {
    if (!IsPostBack)
    {
    Response.Redirect(string.Format("https://kite.trade/connect/login?api_key={0}", apiKey));
    }
    }
    Now run the Kite.aspx page, and you will be redirected to the kite login page. On successful login you will be automatically redirected to the Redirect.aspx page.
  • pawandev
    Thanks Joy for your prompt reply. I have tried and it is working great. please guide me on the following things:-
    1. The redirect url (on live website) should have SSL or not?
    2. Please provide a small code snippet to place order?

    Thanks very much to contributing your time to solve my problem
This discussion has been closed.