py5paisa
py5paisa copied to clipboard
unable to do authentication
- 5paisa Python SDK version:0.1.6
- Python version:3.7.7
- Operating System:Win10
Description
I just configure the keys.conf file and tried executing client.login()
but it ended up with below error :
Traceback (most recent call last):
File "main_paisa.py", line 4, in
Please note: I have configured keys.conf file without quotes and provided proper input to FivePaisaClient() like below: client = FivePaisaClient(email="[email protected]", passwd="xxxxxxx", dob="yyyymmdd")
@ankitcs08 please recheck u have configured correctly, i tried simulating but couldn't recreate this error... I am able to login without any issue...
also recheck you are using latest py5paisa code..
I am too getting the same error message:
TypeError: 'NoneType' object is not subscriptable
I have opened an account with them recently and facing the same issue. Digging into the code I figured that the API response received is: {"body":null,"head":{"responseCode":"5PLoginV2","status":"2","statusDescription":"Invalid head parameters."}} This response is insufficient to figure out what parameter could be incorrect or if the account does not have access to the APIs. I have also tried using the login API(https://www.5paisa.com/developerapi/userlogin) directly to no avail. There is supposedly a newer version(V3 as against V2 used by the python and go APIs). Interestingly, the new API returns success but does not return a valid body: { "body": { ... "ClientCode": "", ... }, "head": { "responseCode": "5PLoginV3", "status": "0", "statusDescription": "Success" } } I have written to 5paisa support yesterday but haven't received a response yet. Let's hope they respond soon.
Same issue with me, the body is not valid. Just for confirmation, i edited the LOGIN_ROUTE to "https://Openapi.5paisa.com/VendorsAPI/Service1.svc/V3/LoginRequestMobileNewbyEmail" and self.payload["head"]["requestCode"] = "5PLoginV3" in py5paisa.py
If i execute client.margin() it prints - 'Invalid Input Parameters' despite the success returned on client.login() Is there anything i am missing?
I encountered a similar issue with golang API as reported here
I am getting the same issue
Traceback (most recent call last):
File "C:\demo\5paisa-python\auth.py", line 4, in
@bugf1nd3r @sunnylbk @yadipadlakha @anilgupta83 @ankitcs08 @adish1501 I have fixed the login issue in a new release.
Please install the latest release using pip install py5paisa==0.1.8.
If it fixes your issue, please close this issue or else mention me here.
Thanks! :tada:
@bugf1nd3r @sunnylbk @yadipadlakha @anilgupta83 @ankitcs08 @adish1501 I have fixed the login issue in a new release. Please install the latest release using
pip install py5paisa==0.1.8. If it fixes your issue, please close this issue or else mention me here. Thanks!
Still getting error in 0.1.8
I am facing the same issue
What is the error after the latest release?
client.login() 14:55:42 | Invalid Input Parameters.
Unable to login from python code
I am facing the same issue
have u resolved the issue?
Am getting the same error :(
I am also facing the same issue. this is what I am getting in response at _lognrequest() in py5paisa.py file {"body":null,"head":{"responseCode":"5PLoginV4","status":"2","statusDescription":"Invalid head parameters."}}
I checked all the parameters 5-6 time, even used copy menthod but still facing the same issue. here is the code:
from py5paisa import FivePaisaClient email="anit********.com" pwd="v*****09" dob="1901"
cred={ "APP_NAME": "5P53046136", "APP_SOURCE":"9911", "USER_ID":"X1nzoWbOOUT", "PASSWORD":"6Ta3", "USER_KEY":"ric0LtaSefX5tTO", "ENCRYPTION_KEY":"ISjHPx**1ip6Ro" }
client = FivePaisaClient(email=email, passwd=pwd, dob=dob,cred=cred) client.login()
This is the final response I get after client.login()
17:36:16 | 'NoneType' object is not subscriptable 17:36:16 | 'NoneType' object is not subscriptable
Please Help.
Thanks
I'm facing the same error, wondering if the 5Paisa team has resolution for this..!?
Facing the same issue
They have a new Authentication System: AUTHENTICATION USING OAUTH. As per them, "we have deprecated the existing method which involved the use of login credentials. Kindly go through this updated documentation of using Access token for API Access".
from py5paisa import FivePaisaClient cred={ "APP_NAME":"YOUR APP_NAME", "APP_SOURCE":"YOUR APP_SOURCE", "USER_ID":"YOUR USER_ID", "PASSWORD":"YOUR PASSWORD", "USER_KEY":"YOUR USERKEY", "ENCRYPTION_KEY":"YOUR ENCRYPTION_KEY" }
First get a token by logging in to -> https://dev-openapi.5paisa.com/WebVendorLogin/VLogin/Index?VendorKey=<Your Vendor Key>&ResponseURL=<Redirect URL>
VendorKey is UesrKey for individuals user
for e.g. you can use ResponseURL as https://www.google.com/
Pass the token received in the response url after successful login to get an access token (this also sets the token for all the APIs you use)-
Please note that you need to copy the request token from URL and paste in this code and start the code within 30s.
#This function will automatically take care of generating and sending access token for all your API's
client = FivePaisaClient(cred=cred) client.get_access_token('Your Response Token')
After successful authentication, you should get a Logged in!! message
### HOWEVER IT IS NOT WORKING
getting same error 12:56:53 | Invalid Response Token. 12:56:53 | 'NoneType' object is not subscriptable 12:56:53 | 'NoneType' object is not subscriptable
my code cred={ "APP_NAME":"YOUR APP_NAME", "APP_SOURCE":"YOUR APP_SOURCE", "USER_ID":"YOUR USER_ID", "PASSWORD":"YOUR PASSWORD", "USER_KEY":"YOUR USERKEY", "ENCRYPTION_KEY":"YOUR ENCRYPTION_KEY" } client = FivePaisaClient(cred=cred) client.get_access_token('Your Response Token') client = FivePaisaClient(email="[email protected]", passwd="Password", dob="YYYYMMDD",cred=cred) client.login()
Is there any updates regarding the login issue with the email, password, dob and credentials.
I am getting the response message as None while doing the client.login().
I have checked the credentials and the password multiplt times. Still not able to resolve
is anyone able to resolve this issue ? both username , password and OAuth is not working for me