add auth kwargs parameter#55
Merged
Merged
Conversation
martindurant
reviewed
Jun 8, 2026
martindurant
left a comment
Member
There was a problem hiding this comment.
Looks fine. I would add to the auth documentation about how you can use this without a server using the device code flow, it should be helpful to others.
| The files need to be shared with the service account email address, that can be found | ||
| in the json file. | ||
| :param auth_kwargs: dict | ||
| Additional keyword arguments to pass to the authentication method. |
Member
There was a problem hiding this comment.
May as well explicitly call out your use case of not opening a server?
Collaborator
Author
There was a problem hiding this comment.
thanks! lmk if the wording doesn't feel right. I borrowed from the original get_user_credentials docstring.
Collaborator
Author
|
Hi @martindurant , do you know when you'd cut a release for this? Thank you! We use it in production at marimo btw, very useful project. |
Member
|
Released as 0.4.1 |
6 tasks
Light2Dark
added a commit
to marimo-team/marimo
that referenced
this pull request
Jun 15, 2026
…9884) ## 📝 Summary <!-- If this PR closes any issues, list them here by number (e.g., Closes #123). Detail the specific changes made in this pull request. Explain the problem addressed and how it was resolved. If applicable, provide before and after comparisons, screenshots, or any relevant details to help reviewers understand the changes easily. --> Use out-of-band OAuth settings when marimo runs in an iframe (e.g. molab), and drop the explicit browser token for the default local flow. Browser token is unecessary because that's the default, it will default to "cache" if that's available too. In iframe: <img width="1017" height="367" alt="image" src="https://github.com/user-attachments/assets/f77fef80-5a66-40d3-8c07-4c2b21606db7" /> Note that this new argument `auth_kwargs` is only available in latest [gdrive-fsspec](fsspec/gdrive-fsspec#55) (released a few days ago). `use_local_webserver: True` doesn't work in molab due to molab not exposing a port 8000 to receive the access token. Making that work would require us to create our own oauth client, and to store the creds securely. I've thought of a few ways we can clear the console but settled on this because it's the simplest. - `mo.console.clear()` like API? And call this in the code - Implement a custom UI/widget to display the URL, get the code etc. - OutputRenderer to detect text like "Enter the auth code", and to clear it ## 📋 Pre-Review Checklist <!-- These checks need to be completed before a PR is reviewed --> - [x] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [x] Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it. - [x] Video or media evidence is provided for any visual changes (optional). <!-- PR is more likely to be merged if evidence is provided for changes made --> ## ✅ Merge Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [ ] Documentation has been updated where applicable, including docstrings for API changes. - [x] Tests have been added for the changes made. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/marimo-team/marimo/pull/9884?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. --> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #54.
I opted for a flexible API, but I don't have strong opinions & willing to change. Also fixed running the tests without credentials.
Now I can run the following code in a remote notebook environment
I might need to fix the test in CI.