-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get Response Token using code for Login? #265
Comments
@5paisa Is it possible to login without enabling |
Hi @altimetrikchallenge @crypt0inf0 . I used the TOTP method for logging in, i just did some basic test so i am not sure about the length of session. But sharing the process of successful login. Activating TOTPYou need to activate TOTP from trade station, and copy the TOTP Secret, [which we will use to generate the 2FA password using pyotp which changes every 30 second]. Creating .env fileCreate a .env file and add the values which you will find in Trade station, variable names are pretty intuitive
[I named it ".env" and set it in gitignore, you dont want this in repo for obvious reasons, one can also store them manually in your systems environment variables or using "set APP_NAME=" cmd command] Python codeThe repo is pretty easy to follow, below is the code taking reference from it.
|
Description
Can someone please share the steps you perform to login via Python?
The issue I am facing is that how do you perform these steps?
#> # OAUTH Approach
Manually we hit the url with our VendorKey and Redirect URL, we can get the response token from the url.
How you guys are achieving this automatically? Or should we get this manually and feed to our script?
What I Did
fivePaisaClient = FivePaisaClient(cred=credentialsKeys) respToken = fivePaisaClient.get_totp_session(phnNumber,'TOTP','secretPIN') fivePaisaClient.get_oauth_session("respToken")
When I try the below code I get this error "SSLError: HTTPSConnectionPool(host='dev-openapi.5paisa.com', port=443): Max retries exceeded with url: /WebVendorLogin/VLogin/Index?VendorKey=token&ResponseURL=https://www.yahoo.com (Caused by SSLError(SSLError(1, '[SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1007)')))"
SSLError: HTTPSConnectionPool(host='dev-openapi.5paisa.com', port=443): Max retries exceeded with url: /WebVendorLogin/VLogin/Index?VendorKey=hguh&ResponseURL=https://www.yahoo.com (Caused by SSLError(SSLError(1, '[SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1007)')))
The text was updated successfully, but these errors were encountered: