icingaweb2-module-jira
icingaweb2-module-jira copied to clipboard
Auth with JIRA access token
As an alternative to login with user and password, login with a token should be possible.
[api] host = "jira.example.com" ; port = 443 ; path = "/" ; scheme = "https" ; username = "icinga" ; password = "***" token = "****************************************************"
AFAIC, you don't need to provide a password when using the Jira-token. In our setup, it's sufficient to configure the token in the password field.
@verboEse Unfortunately, no.
Sorry, I wasn't clear. You have to provide the username of course. But you only have to provide either password OR token. Both can be provided in the password field.
@verboEse I don't think that this will work on Server deployments, since the authorization is done via bearer-token (PAT or access token) and not basic-auth. For RestApi (https://github.com/Icinga/icingaweb2-module-jira/blob/main/library/Jira/RestApi.php#L434), there needs to be an addition to use the bearer token, like (for example)
if($config_setting == "bearer-token") {
$auth = null;
$headers[] = "Authorization: Bearer ".$token;
}
@theFeu maybe this is an interesting addition? For the config form, there can be an autosubmit for the type of authorization, username/password or via token. This will switch adding the above mentioned header and removes the basic-authentication. Instead of storing username / password, you will only store the access token.
Heyhey, I'm no longer active in this project.
@raviks789 might be a better person to ask!
@Littlericket,I am currently occupied with other projects. And I am not sure if this will be included in the next release. But I will look into this later.