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

[BUG] - Refreshing token seems broken in some cases #6

Open
heysamtexas opened this issue Oct 22, 2024 · 0 comments
Open

[BUG] - Refreshing token seems broken in some cases #6

heysamtexas opened this issue Oct 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@heysamtexas
Copy link
Owner

There is a case when the refresh_token flow is unable to re-acquire. I assume it is getting a a 401.

My hypothesis is that this is because I'm using the same app keys and secrets for my app with X.

Once I renew in my production app it will invalidate the tokens in dev, and vice-versa.

Therefore, you need to have two separate environments, which X (Twitter) now makes that difficult.

Either way, we should solve this problem below:

  1. Once your refresh token is invalid you need to re-auth the whole thing anyway.

See stack trace:

2024-10-22 13:17:29,137 [DEBUG] Command.run_workflows (run_workflows.py:32): Publishing to access_token = OAuth2ProviderFactory.get_provider("twitter").get_valid_token(destination.oauth2_provider)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "oauth2_capture/services/oauth2.py", line 180, in get_valid_token
user_info=self.get_user_info(token_data["access_token"]),
~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'access_token'

@heysamtexas heysamtexas added the bug Something isn't working label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant