-
Notifications
You must be signed in to change notification settings - Fork 602
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
automating MFA authentication #303
Conversation
- Delete stubs and add a `.gitkeep`
Thank you for the contribution @RobertAgee! I made some slight changes and merged |
automating MFA authentication (robinhood-unofficial#303)
This pull request was quite confusing. from pyzbar.pyzbar import decode
from PIL import Image
# load the image to PIL, if you took a screenshot of your exported account
image = Image.open('data/otp.jpg')
# decode the image
decoded_objects = decode(image)
# print decoded data
for obj in decoded_objects:
print("Type:", obj.type)
print("Data:", obj.data.decode("utf-8")) Then run and make sure you replace the data in the git clone https://github.com/scito/extract_otp_secrets.git
cd extract_otp_secrets
pip install --user -r requirements.txt
python src/extract_otp_secrets.py example_export.txt That will output something like this: Name: Robinhood
Secret: 16-digit QR generation code
Type: totp Then you can log in like this: from pyrh import Robinhood
rh = Robinhood(username='youremail@address.com', password='yourpassword', mfa='16-digit QR generation code') @RobertAgee Thank you for the pull request, though. Great work. |
Hi Kurry, the 16 digit qr code is provided already by robinhood and there is no need to convert the qr image to the 16 digit code. The code along with other credentials can be stored as environment variables or a config file, and imported as parameters for the login. In the future, if you have questions, it's better to submit an issue asking for clarification. |
Interesting. How do you get the 16 digit QR code from Robinhood? |
Oh I see, nvm I see it in the application. Good to know lol |
Checklist
"{ISSUE_NUM}.{feature|bugfix|doc|removal|misc}""
Related Issue
#300 - fixes need for 0auth refreshing by self-authenticating on each login
Description
Utilizes PyOTP library to provide MFA code automatically to RH. User can pass 16-digit QR generation code (obtainable from RH app) to SessionManager as a 'mfa' parameter. However, user still retains the ability to manually validate if desired.
Docstring is updated and newsfragment added. Basic testing added to validate **sample_user.