Skip to content
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

Getting "invalid" grant while fetching app credentials #22

Open
htgoebel opened this issue Dec 6, 2020 · 1 comment
Open

Getting "invalid" grant while fetching app credentials #22

htgoebel opened this issue Dec 6, 2020 · 1 comment

Comments

@htgoebel
Copy link
Contributor

htgoebel commented Dec 6, 2020

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): [email protected]
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
Copy link

33b5e5 commented Nov 23, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants