Skip to content
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

2FA #3

Open
Jenseman33 opened this issue Sep 29, 2022 · 12 comments
Open

2FA #3

Jenseman33 opened this issue Sep 29, 2022 · 12 comments

Comments

@Jenseman33
Copy link

Jenseman33 commented Sep 29, 2022

Hi,
first of all best thanks for coding the API !
Unfortunately it is only possible to order with 2FA active at Wikifolio.
You wrote that you implemented it but it needs further testing.
Is there any newer information on this yet?
I am also willing to test this :D
Thanks
BG
Jens

@henrydatei
Copy link
Owner

Yes, I have implemented 2FA using TOTP. This needs some sort of initial key and than you can use

from wikifolio import Wikifolio

wf = Wikifolio("email", "password", "wikifolioID", "2FA key")
print(wf.performance_ever)

If you make a quote order than the TOTP package will generate a number from you initial key and verify the trade with that.

Unfortunately my wikifolio doesn't use 2FA and I can't activate it without sending my passport etc. to wikifolio, I can never try if everything is working. So if you make any changes please submit a pull request.

@Jenseman33
Copy link
Author

I am sorry, but it doesn´t work.
print(wf.performance_ever) works fine, but I can´t place an order.
I tested the following with pyotp and it generates the correct wikifolio OTP.

import pyotp
totp = pyotp.TOTP("ABCDEFGHIJKLMN")
print("Current OTP:", totp.now())

I don´t see where you are using the temporary key.
To me it looks like you are missing the "totp.now()" in the following part, but I am new to python and can´t figure out how to add it.

if self.twoFA_key != None:
      auth = requests.post('https://www.wikifolio.com/api/totp/verify', data = self.twoFA_key, cookies = self.cookie)
      cookies = auth.cookies

Maybe I am completely wrong.

@henrydatei
Copy link
Owner

I'm also new to using TOTP but I've adapted your working code into the buy and sell quote functions. I don't know if you have to use 2FA when doing limit orders, maybe you can help me with that.

henrydatei added a commit that referenced this issue Oct 1, 2022
@Jenseman33
Copy link
Author

Doesn´t work :D
I think the original key for the TOTP needs to stay in the link but also the temporary key.
How do you know how the "https://www.wikifolio.com/api/totp/verify" link has to look?
I can show you an 2FA Order in Wikifolio if that helps.
Before every trade wikifolio ask for the 2FA so a limit order also needs the 2FA.
This is my Discord name if you want a quick view at a 2FA order.
Jens#6865
I am from Germany.

@Jenseman33
Copy link
Author

The quote order doesn´t work for me.
I get the following error and with my limited skills I can´t fix it:

"websocket._exceptions.WebSocketBadStatusException: Handshake status 400 Bad Request"

Feel free to write me if you need 2FA login data.
I will keep using your wikifolio api without the order option.
Thanks that you made it public!

@henrydatei
Copy link
Owner

I think currently no orders at all work, even limit orders:

{
 "success":false,
 "reason":"An error of unclarified origin has occurred. If the error persists, contact support@wikifolio.com."
}

@henrydatei
Copy link
Owner

I've asked other creators of API wrappers if they have the same issues: RienNeVaPlus/wikifolio#22

@quantomas
Copy link
Contributor

Hi everybody, this is a cool package. I have tested it on my wikifolio. I don't use 2FA. The package works fine with limit and stop-limit-orders (I have added several methods into the class). Never encountered any issues. My wikifolio is not yet investible. But with the current wikifolio (test phase), no problems so far. As far as I know, 2FA is optional. What don't you simply change your login procedure to the old style (mail and password)?

@quantomas
Copy link
Contributor

Summary: everything in this package (I don't use everything, but portfolio assets, executed trades, orders are very important for me) was tested by me for several months, I have also added many usefull things. Currently, I cannot check the 2FA feature. My wikifolio is not investible yet. I will check the situation once I have applied for the "emission process". It looks that 2FA is mandatory in this case. We will see.

@quantomas
Copy link
Contributor

quantomas commented Feb 19, 2023

Very important suggestion for everbody using this package! Don't overdo the API calls. The wikifolio team is not stupid, make pauses/delays between EVERY api action, for example a few seconds. Otherwise it is likely that your IP or account gets blocked. Don't abuse this package to "make a full copy" of the wikifolios on our machine. Only use what you really need!

@Jenseman33
Copy link
Author

2FA is mandatory for investable wikifolios and you can't deactivate 2FA afterwards. It is still possible to get the wikifolio information with 2FA activated but the order options wont work.

@quantomas
Copy link
Contributor

quantomas commented Feb 19, 2023

2FA is mandatory for investable wikifolios and you can't deactivate 2FA afterwards. It is still possible to get the wikifolio information with 2FA activated but the order options wont work.

Do you know if wikifolio is going to offer an "api-like interface" for orders? Otherwise it is VERY tedious to place hundreds of orders everyday. From my point of view, a professional trading style requires this amount of orders every single day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants