-
Notifications
You must be signed in to change notification settings - Fork 463
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
Support Basic auth for backend requests #1048
Comments
Hi! Could you show the plugin config? Also, you can enable debug logging in grafana and show logs from the grafana-server when you press save and test button. In this case plugin sends |
Hi Alex, I believe it's failing at the htaccess level I believe, and that config hasn't changed. Relevant (anonymized) info posted: Grafana log with debug: t=2020-09-14T08:19:45-0400 lvl=dbug msg="Zabbix API request" logger=plugins.backend pluginId=alexanderzobnin-zabbix-datasource datasource=Zabbix method=apiinfo.version Apache log on the web server: Curl output from grafana to the web server, not giving the same 401 error: curl -v -su 'apiuser' https://zabbixweb/api/api_jsonrpc.php Enter host password for user 'apiuser':
|
So you're using Basic auth, right? It looks like it's not implemented in plugin. |
Could you please clarify why this used to work and now doesn't? Do you have any idea? |
I'm experiencing the same issue and will patiently wait for 4.0.2. Any release date known at this point? |
@hluaces Previously plugin had only frontend part and all queries were sent by Grafana backend. Now plugin has it's own backend which invokes requests, so this requires basic auth to be implemented in the plugin (or in the grafana plugin SDK, but it doesn't have this feature now). |
@alexanderzobnin thanks for taking the time to answer me and for your work. |
Fixed in d2e9c2b |
I recently upgraded from Grafana 6.5.2 and plugin 3.12.4 to Grafana 7.1.5 and plugin 4.0.1, and when testing the datasource I'm getting a 401 error in Apache.
Before upgrade (IP and user anonymized)
xx.xx.xx.xx - apiuser [04/Sep/2020:08:50:10 -0400] "POST /api/api_jsonrpc.php HTTP/1.1" 200 41 "-" "Grafana/6.5.2"
After upgrading Grafana:
xx.xx.xx.xx - apiuser [04/Sep/2020:08:55:16 -0400] "POST /api/api_jsonrpc.php HTTP/1.1" 200 68 "-" "Grafana/7.1.5"
After upgrading plugin:
xx.xx.xx.xx - - [04/Sep/2020:08:59:55 -0400] "POST /api/api_jsonrpc.php HTTP/1.1" 401 381 "-" "Grafana/grafana-zabbix"
For some reason it's getting the 401 381 error - is it not passing the API user? I also tested credentials using curl and did not get the 401 error (unless I deliberately entered a wrong password of course)
Is there a config I need to change or is this a bug?
RHEL 7.8, Apache 2.4.6, Zabbix 4.4.6.
The text was updated successfully, but these errors were encountered: