-
-
Notifications
You must be signed in to change notification settings - Fork 184
MFA & Security
Updated: 2021/03/04
If you are getting the error below:
{'success': False, 'msg': 'deviceId=null'}
or
{'msg': 'System error.', 'traceId': 'XXXXXXXXXXXXXXXXXXXXXXXXX', 'code': 'system.error'}
That might be because Webull has made MFA mandatory after 2020/05/27.
And they added Security Question in 2021/02/06.
In order to accomplish the MFA challenge, you will need to obtain the mfa first:
wb.get_mfa(webull_email) #mobile number should be okay as well.
wb.get_security(webull_email) #get your security question.
You will then obtain the MFA code (6 digits) through Email or SMS.
You will get an output like this: [{'questionId': '1001', 'questionName': "What's your birth month and day?"}]
If needed you can request a different security question using:
wb.next_security(webull_email) #This can be used to request an alternate security question
Now use that information to login:
data = wb.login(webull_email, webull_pass, 'Any Name You Like', '123456', '1001', 'XXXX') # 6 digits MFA, Security Question ID, Question Answer.
Any Name You Like
can be anything, it will show up under listed devices in your Webull Two Factor Auth in the app.
Once you have completed the MFA login, you should be able to login without MFA codes after that.
But it is strongly recommended that you use the refreshToken
to update your accessToken
by calling the wb.refresh_login()
function when you are about to run the script and record the refreshToken
and the accessToken
again so you won't have to face the challenge every time.
If you like the project and would like me to devote my time to it, you can support me here directly :
You can always help by contributing to the project directly with PR. Make sure that you don't upload your account credentials accidentally.
https://github.com/tedchou12/webull/wiki/For-Developers-Contributors