Kotak-Neo / kotak-neo-api

115 stars 105 forks source link

Login not working #20

Closed renjithsasidharan closed 1 year ago

renjithsasidharan commented 1 year ago
self.api = NeoAPI(
            consumer_key=consumer_key,
            consumer_secret=consumer_secret,
            environment='prod',
            on_message=on_message,
            on_error=on_error,
            on_close=None,
            on_open=None,
        )
self.api.login(
            mobilenumber=mobile_number,
            password=password,
        )

I am using the prod credentials from developer portal and neo web portal's password but I get TypeError: can only concatenate str (not "NoneType") to str from login_api.py:58 I debugged and found that LoginAPI.session_init returns 401

Kotak-Neo commented 1 year ago

Try printing the response message of the login API and share that to debug the issue.

renjithsasidharan commented 1 year ago

@Kotak-Neo I get <Response [401]>{"error_description":"invalid_client","error":"invalid_client"} from session_init Let me know If you need more details

renjithsasidharan commented 1 year ago

Hmm, I think I was using the client id and secret from tradeapi.kotaksecurities.com. I registed in napi.kotaksecurities.com and tried using the credentials from that now its working. It is confusing as to what is to be used to to authenticate with APIs.

Thanks for responding quickly to the issue anyways