-
Notifications
You must be signed in to change notification settings - Fork 175
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
Trino Client prompting for authentication at every Cursor created when using OAuth2Authentication #224
Comments
My suspicion is that you use a remote Jupyter server on a headless server. This would mean that there is no webbrowser to launch and you only see the console output. To make this work on the notebook server, the url should be captured and launched in your clientside webbrowser session. Also the cache should be made persistent over requests to the Jupyter server (through a custom cache hook as in #223). A potential workaround is to use a long lived token and use JWT authentication. |
I'm not sure I understand the first part of your answer. The URL is launched on the webbrowser (I actually get a new tab with the authentication taking place). Isn't that right or am I missing something? For the cache part I thought InMemory default one would work, but I'll check the custom cache solution! |
Good to hear that the webbrowser works, I assume you run the notebook server locally then. It would not work if it's on a remote server that doesn't have a webbrowser.
You might be right about this as the Python kernel in Jupyter must be kept alive including the inMemory cache. I will give it a try myself over the weekend. |
You're absolutely right! I assume that I should be able to reuse the connection without having to authenticate multiple times, right? Thanks (= |
Curiously enough I couldn't find what the issue behind it was. Eventually at the production environment (Jupyterhub on EKS) everything worked as expected, being able to reuse the connection and create new cursors without any needs to keep authenticating at every new cursor. Unless you'd like to debug more to understand why my original setup was having this issue we can close the issue (= |
We now have a built-in token cache which should reuse OAuth tokens as long as you connect using same user and to same Trino URI. |
Hello! I'm using the client to query Starburst.
I've been trying to understand how the Cache works for OAuth2Authentication since it's prompting for authentication at every cursor created.
I imagine it'd make sense to prompt for it at each connection created but not at every cursor, if not closing the previous opened connection.
I've got that error with the following code:
If I reuse the same cursor this behavior doesn't happen and I don't need to authenticate multiple times.
The text was updated successfully, but these errors were encountered: