trinodb / grafana-trino

The Trino datasource allows to query and visualize Trino data from within Grafana.
Apache License 2.0
36 stars 16 forks source link

Implement OAuth 2 #32

Closed nineinchnick closed 6 days ago

nineinchnick commented 2 years ago

Enable forwarding OAuth tokens and handle them in the backend to pass them into the driver.

harksin commented 4 months ago

anyone working on this already ?

nineinchnick commented 4 months ago

I'm not aware of anyone working on it. Any contributions are very appreciated!

hiepqdinh commented 2 months ago

Maybe I'm a bit naive here, but isn't it as simple as setting opts.ForwardHTTPHeaders = true when creating the http client, as per this instruction: https://grafana.com/developers/plugin-tools/how-to-guides/data-source-plugins/add-authentication-for-data-source-plugins#forward-oauth-identity-for-the-logged-in-user

And the code in grafana-trino to create httpclient is here https://github.com/trinodb/grafana-trino/blob/80215f4bb10b3b586bf8107c8eeea54cce2957df/pkg/trino/driver/driver.go#L43C2-L43C8

harksin commented 3 weeks ago

hello :wave: @kalil-pelissier & I are working on it on nudibranches tech side we should hopefully be able to provide a PR next week. Is there anyone here we could ask if we need some help?