-
Incident report
-
Resolution: Unresolved
-
Trivial
-
None
-
None
-
Zabbix server 7.4.2 with latest Jira Service Management and Jira media type templates from git.zabbix.com
Steps to reproduce:
- in Jira disable basic auth for API calls in Administration > System > Authentificationmethods > Authentication
- in Zabbix configure Jira Service Management media type template with the corresponding values for:
- jira_password: enter personal access token for a Jira user
- jira_request_type_id: as required
- jira_servicedesk_id: as required
- jira_url: as required
- jira_user: Jira user to use
- Click on "Test" for the configured media type
Result:
Media type test failed:
Sending failed: Unknown error. Check debug log for more information
Log output shows the following error:
00:00:00.022 [Debug] [Jira Service Management Webhook] Response has been received: {"message":"Die Standardauthentifizierung wurde in dieser Instanz deaktiviert."}00:00:00.022 [Warning] [Jira Service Management Webhook] HTTP code: 40300:00:00.022 [Warning] [Jira Service Management Webhook] Request not successful. Received response: {"message":"Die Standardauthentifizierung wurde in dieser Instanz deaktiviert."}
The message "Die Standardauthentifizierung wurde in dieser Instanz deaktiviert." means: "Basic authentication has been disabled in this instance."
Expected:
Media type test succeeds regardless of basic authentification oder personal access token usage
Possible cause/solution:
This error seems to be caused by line 577 of Jira Service Management (Jira: 573) template:
this.request.addHeaders('Authorization: Basic ' + btoa(this.params.jira_user + ':' + this.params.jira_password));
for Personal access token usage this must be:
this.request.addHeaders('Authorization: Bearer ' + this.params.jira_password);
Maybe the best solution might be an additional paramter for the templates which allows an selection of the authentication method to use like jira_auth_type with valid values of 0 (basic auth) or 1 (bearer/pat auth) and a switch which selects the corresponding of both mentionend authentication headers.
Currently I hard coded/updated all Authorization headers in the templates to use Bearer token.