itsjafer / schwab-api

A python library for placing trades on Charles Schwab
MIT License
201 stars 64 forks source link

Symantec ID not working anymore #52

Closed micheleissa closed 6 months ago

micheleissa commented 6 months ago

Hello, First let me thank you for this great package! Login started to fail today and even logging into the app or web is not working stating security code is not valid. I called customer support and when they tried the Symantec Id I had or any new one generated by the script it is not working. Would it be possible for you to look into that? I mean is the vipaccess package not the latest version or its author might have addressed the issue in a newer version ? Sorry if I'm making some assumptions here, my python knowledge is rather limited.

Michel

4rumprom commented 6 months ago

Did you try updating to 0.3.11? It has a fix for login issues. Although it is not directly related to TOTP but the error message was misleading. Did you try google authenticator? It's good to have that as a backup. Enter your TOTP in google authenticator and see if the codes match up with one generated by the script.

micheleissa commented 6 months ago

I have upgraded to 0.3.11

image

Am I missing something? Now I tried generating a completely new TOTP and it works fine via the web app and the mobile app but still the login routine falls into the SMS flow like the following:

image
4rumprom commented 6 months ago

I did some testing. If your password or login are incorrect, you'd raise the error: Exception: Login was not successful; please check username and password| When the TOTP is either missing or entered incorrectly, it will return that error message you are seeing.

You might really want to make sure you're passing the correct TOTP.

micheleissa commented 6 months ago

I tried a brand newly generated TOTP and it did not work then I retried the original one and the second time it worked. I'm pretty sure I'm sending the correct secret every time but anyway it might have been copy/paste error. Thanks for the response. I'm closing the issue.

4rumprom commented 5 months ago

When was your daylight savings time change? As of this morning, I am having this issue and we just changed time. I wonder if it may be linked to time change.

micheleissa commented 5 months ago

That is interesting, I believe the time change was like 2 days ago. Yours did not work the whole day today?

micheleissa commented 5 months ago

@4rumprom are you still facing the issue? I had some login time outs this morning.

4rumprom commented 5 months ago

Not anymore but the issue was a change of the landing page url on the schwab side. I saw a pull request to check for the updated url on schwab with version 0.3.12 but it's not deployed yet. I've submitted a modification in my async pull request to make it more robust by looking for the keywords app/trade in the url rather than looking for an exact url match.

In the meantime, you may want to update urls.py under the schwab_api package with the following code: def trade_ticket(): return "https://client.schwab.com/app/trade/tom/trade?ShowUN=YES"

micheleissa commented 5 months ago

With the change you suggested it is working now. I hope Schwab releases the API soon the traversing of the UI is very flaky.

4rumprom commented 5 months ago

Currently, the login is what's problematic. Once logged in, the Schwab API is already being used. You'd probably still want to have a python wrapper to interface with the Schwab API anyways, as it was the case with TDA. Once authentication can be done via the API, it will be better.

On Thu, Mar 14, 2024, 11:19 AM Michel Eissa @.***> wrote:

With the change you suggested it is working now. I hope Schwab releases the API soon the traversing of the UI is very flaky.

— Reply to this email directly, view it on GitHub https://github.com/itsjafer/schwab-api/issues/52#issuecomment-1997703717, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUBF3VBP6DG265UBHNBKLG3YYG5Y3AVCNFSM6AAAAABEJ36SB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJXG4YDGNZRG4 . You are receiving this because you were mentioned.Message ID: @.***>

micheleissa commented 5 months ago

I understand Schwab API is being used after the login, what I meant is the how currently the login is implemented. I also used to use TDA when it was working. Even at my job when QA teams decide to do E2E via Selenium the tests are fragile due to the nature of the system under test being the UI.

micheleissa commented 5 months ago

Hey @4rumprom quick question. now your async changes are merged in. This means I can run a script via Jupyter right? sorry if the question is silly :) I'm using this as an opportunity to strengthen my skills in python.

4rumprom commented 5 months ago

I didn't specifically try it on Jupyter but yes, the idea was that running async would be more compatible with spyder / jupyter / steamlit or other systems that don't support synchronous playwright.

On Fri, Mar 15, 2024 at 10:04 AM Michel Eissa @.***> wrote:

Hey @4rumprom https://github.com/4rumprom quick question. now your async changes are merged in. This means I can run a script via Jupyter right? sorry if the question is silly :) I'm using this as an opportunity to strengthen my skills in python.

— Reply to this email directly, view it on GitHub https://github.com/itsjafer/schwab-api/issues/52#issuecomment-1999740083, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUBF3VEQOKKXJKEDIVV7TU3YYL5WRAVCNFSM6AAAAABEJ36SB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJZG42DAMBYGM . You are receiving this because you were mentioned.Message ID: @.***>

micheleissa commented 5 months ago

yea I tried in jupyter but getting the following error, it seems to be conflicting with Jupyter's running event loop.

image
4rumprom commented 5 months ago

Do you mind opening a new issue for this? In your new issue, if you could also please share what code are you running. Did you try running the example to test it?

micheleissa commented 5 months ago

I have copied and pasted from the example but I can try again then open a new issue.