Shreddit icon indicating copy to clipboard operation
Shreddit copied to clipboard

Does not work with new 2FA enabled

Open scottjl opened this issue 7 years ago • 7 comments

Reddit has implemented a 2FA option. If this is enabled on the account schreddit fails with:

Traceback (most recent call last):
  File "/usr/local/bin/shreddit", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/shreddit/app.py", line 44, in main
    shredder = Shredder(default_config, args.user)
  File "/usr/local/lib/python2.7/dist-packages/shreddit/shredder.py", line 28, in __init__
    self._connect()
  File "/usr/local/lib/python2.7/dist-packages/shreddit/shredder.py", line 85, in _connect
    raise ShredditError("Bad username or password")
shreddit.util.ShredditError: 'Bad username or password'

Disabling 2FA allows it to work again.

scottjl avatar Jan 26 '18 11:01 scottjl

this is an issue with praw more so than shreddit. It is supported but a PITA.

Edit praw.ini and in the password field set it so it's password:2fa_code, then run shreddit

arbie65 avatar Feb 06 '18 22:02 arbie65

That worked one time. Thanks, @arbie65!

Sadly, it stopped working once the 2FA code renewed =/

arcataroger avatar Feb 09 '18 06:02 arcataroger

Hmmm changing the PW field to a 2FA code did nothing for me. I mean, why would that work? Surely you need a password still.

Only way so far is to disable 2fa when you want to use shreddit. Pretty annoying but liveable.

ghost avatar Mar 20 '18 22:03 ghost

No, you can do it like this: password:2facode

(first the password, then a colon, then the 2fa code)

But it only works once time. The next 2FA code change a minute or two later will break it.

arcataroger avatar Mar 20 '18 22:03 arcataroger

@arcataroger you need to put in the updated 2fa code each time you want to run shreddit.

grrrrr avatar Mar 26 '18 12:03 grrrrr

would it be too much to implement TOTP so a user would provide the shared secret instead of 2FA code? there are libraries for it out there. this is so we could use the script with cron.

opark avatar May 17 '18 14:05 opark

@opark this is a request for praw-dev/praw which handles the authentication

grrrrr avatar May 23 '18 08:05 grrrrr