Comments (2)
Great question! Here's why we use TOTP authentication: If we use a TOTP to login, we don't need to manually take an SMS code as input everytime we login because we can programmatically generate the one-time 6-digit passcode.
There are two components to doing this:
- the TOTP secret: this is the super long key that's generated. This is the string that you provide to the schwab API so it can automatically generate the 6 digit codes without your manual input.
- your authenticator app: next time you want to login through the normal schwab website, it'll ask you for the one-time passcode. You'll need the authenticator app in order to generate the code when not using this API!
So in summary:
- Generate a TOTP secret and symantec ID using the code above.
- Enter the symantec ID on your schwab security center
- Write down the TOTP secret somewhere in your notes as well as input it into your authenticator app
- When using the schwab_api, provide your username, password, and TOTP secret so that the API can login (you don't need to worry about the six digit code, the API will generate that automatically)
- When logging in normally, you'll need the authenticator app to generate the TOTP code
You asked where do we enter the TOTP secret into the codelab, we input it here:
# Login using playwright
print("Logging into Schwab")
logged_in = api.login(
username=username,
password=password,
totp_secret=totp_secret # Get this by generating TOTP at https://itsjafer.com/#/schwab
)
from schwab-api.
Thanks a lot for the explanation - never noticed that schwab has such an option in the security center.
from schwab-api.
Related Issues (20)
- Can't place order - This account currently holds %1% shares of %SYMBOL%. (AC109) HOT 10
- Is there a way to pull ticker info like in the TD API? HOT 10
- Selecting account for orders_v2 HOT 11
- Error: "request entity too large" HOT 6
- Auto renew token HOT 2
- margin account orders hit and miss HOT 11
- quote function change? HOT 4
- Options not working anymore HOT 9
- Error when placing order: This order cannot be accepted. Please ensure logged into correct account for order processing through Charles Schwab or TD Ameritrade HOT 1
- Response 413 error in get_account_info_v2() HOT 3
- `get_account_info_v2` KeyError: costDetail HOT 1
- Unable to login - Timeout error HOT 1
- order confirmation to buy or sell a symbol that's traded before today HOT 1
- Locking My Account HOT 3
- Login issue HOT 6
- TOTP login failing HOT 1
- Symantec ID not working anymore HOT 16
- Allow session to be cached to disk HOT 5
- totp secret HOT 1
- Welcome to Charles Schwab Developer Club (including migration from TD). HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from schwab-api.