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

ERROR invalid_grant #450

Open
davidwagner opened this issue Sep 12, 2020 · 3 comments
Open

ERROR invalid_grant #450

davidwagner opened this issue Sep 12, 2020 · 3 comments

Comments

@davidwagner
Copy link

We have dozens of students in Data 8 who have experienced

ERROR | auth.py:102 | {'error': 'invalid_grant'}

when trying to log into okpy from a Jupyter notebook (_ = ok.auth(inline=True)). I can't track down any commonality into what is causing this. The workaround/hack we have been using is to add force=True, but that is not ideal because then it requires them to reauthenticate every time. Also it seems like a kludge to paper over an issue, and it would be nice to understand what is causing this problem and fix it.

How would I go about debugging / troubleshooting this?

@rahularya50
Copy link
Contributor

I'd suggest following the instructions in the README to get a copy of OKPy running locally that's built from this repo. Then put some print statements in https://github.com/okpy/ok-client/blob/master/client/utils/auth.py to see where reauthentication is failing.

@rahularya50
Copy link
Contributor

It might be that the reauthentication process does not take into consideration Jupyter notebooks, since that error is what you get when your token has expired on the CLI client.

@rahularya50
Copy link
Contributor

        try:
            access_token = refresh_local_token(server)
        except OAuthException as e:
            # Account for Invalid Grant Error During make_token_post
            if not silent:
                raise e
            return notebook_authenticate(cmd_args, force=True, silent=False)

is what might not be working. Check to see if it's even reaching this point?

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