simPod / GrafanaJsonDatasource

Grafana datasource to load JSON data over your arbitrary HTTP backend
https://grafana.com/grafana/plugins/simpod-json-datasource/
MIT License
355 stars 72 forks source link

Add custom header authentication #179

Closed odoucet closed 3 years ago

odoucet commented 3 years ago

This plugin allows only basic auth at the moment. It would be great to be able to add "Custom HTTP Headers" like almost all core datasources. It would allow to handle many more authentication systems (Bearer token, ... or just custom auth system !).

It seems to be very generic in datasource plugins, so I guess it's not that difficult to add.

I've never developed anything on Grafana so if you point me in the right direction, I can try creating a pull request on that.

simPod commented 3 years ago

It is possible to add in datasource settings. I'm leveraging Grafana's http datasource which has that feature https://github.com/simPod/GrafanaJsonDatasource/blob/58bc594b610b6043ff878d9a729513b621bf8a25/src/Component/ConfigEditor.tsx#L11

odoucet commented 3 years ago

Ahh, I just need to set "access = server", and custom http headers are now shown ! Thank you, did not see the trick.

simPod commented 3 years ago

Did not know that either 😅 Guess I'll add it to Readme.

On Fri, Jul 9, 2021, 11:40 Olivier Doucet @.***> wrote:

Ahh, I just need to set "access = server", and custom http headers are now shown ! Thank you, did not see the trick.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/simPod/GrafanaJsonDatasource/issues/179#issuecomment-877057104, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACQAJJXIHVG65WJ6TTTTELTW27YTANCNFSM5ACEXQWA .

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.