-
I'm not sure if this is a documentation/feature request, I'm trying to figure out oauth2 to google cloud platform to fetch a secret inside of marimo wasm notebook. Is this currently possible? As far as I can tell I'm required to add a redirect uri, I figured maybe I could get this working by redirecting back to my notebook with a variable to set an argument or something like that, but I can't figure that out and I'm not entirely clear on what's required! I could also probably do the oauth workflow in pyodide+javascript? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
hey @andaag, we have a few internal examples of using oauth2 with notebooks. For the most flexibility, you can follow this guide: https://docs.marimo.io/guides/deploying/programmatically/ It is also possible to set up OAuth2 creds as a Desktop App (instead of Web App), if your use-case fits that, which I don't think will require a redirect. And doing something like: from google_auth_oauthlib.flow import InstalledAppFlow
flow = InstalledAppFlow.from_client_secrets_file(
"credentials.json", SCOPES
)
creds = flow.run_local_server(port=0) |
Beta Was this translation helpful? Give feedback.
Oh sorry, i missed the wasm requirement from the beginning. Yea those libraries and snippets won't work - they do spin up a server.
I would probably put up a small proxy server in front of the wasm notebook instead of doing it inside the wasm notebook itself. It's more work, but it shareable and re-usable.