edsu / feediverse

Send RSS/Atom feeds to Mastodon
MIT License
112 stars 23 forks source link

Getting "invalid" grant while fetching app credentials #22

Open htgoebel opened 3 years ago

htgoebel commented 3 years ago

When trying to get a new access token, feediverse crashes when tries to log into Mastodon:

$ ./feediverse.py /tmp/feed.rc
What is your Mastodon Instance URL? https://my.server
Do you have your app credentials already? [y/n] n
Ok, I'll need a few things in order to get your access token
app name (e.g. feediverse): feediverse
mastodon username (email): me@my.server
mastodon password (not stored): myPassword
Traceback (most recent call last):
  File "/tmp/xxxx/lib64/python3.7/site-packages/mastodon/Mastodon.py", line 414, in log_in
    response = self.__api_request('POST', '/oauth/token', params, do_ratelimiting=False)
  File "/tmp/xxxx/lib64/python3.7/site-packages/mastodon/Mastodon.py", line 2235, in __api_request
    error_msg)
mastodon.Mastodon.MastodonAPIError: ('Mastodon API returned error', 400, 'Bad Request', 'invalid_grant')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./feediverse.py", line 273, in <module>
    main()
  File "./feediverse.py", line 48, in main
    setup(config_file)        
  File "./feediverse.py", line 247, in setup
    access_token = m.log_in(username, password)
  File "/tmp/xxxx/lib64/python3.7/site-packages/mastodon/Mastodon.py", line 420, in log_in
    raise MastodonIllegalArgumentError('Invalid user name, password, or redirect_uris: %s' % e)
mastodon.Mastodon.MastodonIllegalArgumentError: Invalid user name, password, or redirect_uris: ('Mastodon API returned error', 400, 'Bad Request', 'invalid_grant')

I double-checked the password.

33b5e5 commented 1 year ago

I get the same. My hunch is that it's because I have enabled 2FA on my Mastodon account. I'm not sure feediverse supports 2FA as it doesn't prompt for it.