osparamatrix / ks-orderapi-python

47 stars 59 forks source link

Unable to Login : Error Invalid Credentials #28

Open prasadraju070 opened 3 years ago

prasadraju070 commented 3 years ago

Please someone provide running code to login...not working tried all the probabilities

import json from ks_api_client import ks_api

credentials_file = open("credentials.json","r") credentials = json.load(credentials_file) credentials_file.close()

try: client = ks_api.KSTradeApi(access_token = credentials["accessToken"], userid = credentials["userID"],consumer_key = credentials["consumerKey"], ip = "", app_id = credentials["appID"]) client.login(password = credentials["password"]) client.session_2fa(access_code = "6032")

except Exception as e: print("Exception %s\n" % e)

//Error is Exception (401) Reason: Unauthorized HTTP response body: {"fault":{"code":900901,"message":"Invalid Credentials","description":"Access failure for API: /apim/session/1.0, version: 1.0 status: (900901) - Invalid Credentials. Make sure you have provided the correct security credentials"}}

//my username is which I use to login to my kotak account ...Should i use client ID instead? //App ID is blank in my code //i had set access token expiry to -1

nishu88 commented 3 years ago

@prasadraju070 I think, u need to subscribe to session's API from https://tradeapi.kotaksecurities.com/devportal/apis

prasadraju070 commented 3 years ago

i already subscribed ....not working kindly help out

nishu88 commented 3 years ago

Which password did u use? Kotak api login or kotak securities?

prasadraju070 commented 3 years ago

I used kotak securities password and username is TR23051991... I am not able to login to kotak api site directly... Getting invalid password error....

On Mon, 9 Aug, 2021, 8:46 pm Nishanth D Aluhonnu, @.***> wrote:

Which password did u use? Kotak api login or kotak securities?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/osparamatrix/ks-orderapi-python/issues/28#issuecomment-895310862, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUMTF557IOYJ47JYL2C77D3T37WLRANCNFSM5BVCBEKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

prasadraju070 commented 3 years ago

Getting error while logging into using the credentials which I received in mail while I created tradeapi....

On Mon, 9 Aug, 2021, 8:47 pm Rajendra Prasad, @.***> wrote:

I used kotak securities password and username is TR23051991... I am not able to login to kotak api site directly... Getting invalid password error....

On Mon, 9 Aug, 2021, 8:46 pm Nishanth D Aluhonnu, < @.***> wrote:

Which password did u use? Kotak api login or kotak securities?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/osparamatrix/ks-orderapi-python/issues/28#issuecomment-895310862, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUMTF557IOYJ47JYL2C77D3T37WLRANCNFSM5BVCBEKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

nishu88 commented 3 years ago

Read all the previous threads and issues... https://github.com/osparamatrix/ks-orderapi-python/issues/18

You will get a email from kotak api with APPID and different password to login to kotak api site...

prasadraju070 commented 3 years ago

Thanks, I'll check it out...

On Mon, 9 Aug, 2021, 8:54 pm Nishanth D Aluhonnu, @.***> wrote:

Read all the previous threads and issues...

18 https://github.com/osparamatrix/ks-orderapi-python/issues/18

You will get a email from kotak api with APPID and different password to login to kotak api site...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/osparamatrix/ks-orderapi-python/issues/28#issuecomment-895316957, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUMTF5YPJT7HNRWD7XU3QUDT37XJNANCNFSM5BVCBEKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

kalilinux-png commented 3 years ago

Please someone provide running code to login...not working tried all the probabilities

import json from ks_api_client import ks_api

credentials_file = open("credentials.json","r") credentials = json.load(credentials_file) credentials_file.close()

try: client = ks_api.KSTradeApi(access_token = credentials["accessToken"], userid = credentials["userID"],consumer_key = credentials["consumerKey"], ip = "", app_id = credentials["appID"]) client.login(password = credentials["password"]) client.session_2fa(access_code = "6032")

except Exception as e: print("Exception %s\n" % e)

//Error is Exception (401) Reason: Unauthorized HTTP response body: {"fault":{"code":900901,"message":"Invalid Credentials","description":"Access failure for API: /apim/session/1.0, version: 1.0 status: (900901) - Invalid Credentials. Make sure you have provided the correct security credentials"}}

//my username is which I use to login to my kotak account ...Should i use client ID instead? //App ID is blank in my code //i had set access token expiry to -1

https://youtu.be/JYQ0lDyIbwM

kalilinux-png commented 3 years ago

@nishu88 @prasadraju070 @thebhushanp @shubhamzemse94 check out this video tutorial for help