icingaweb2-module-jira icon indicating copy to clipboard operation
icingaweb2-module-jira copied to clipboard

Auth with JIRA access token

Open JuergenLandt opened this issue 3 years ago • 6 comments

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 = "****************************************************"

JuergenLandt avatar Jun 18 '21 14:06 JuergenLandt

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 avatar Feb 08 '23 09:02 verboEse

@verboEse Unfortunately, no. image

Littlericket avatar Jun 11 '24 09:06 Littlericket

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 avatar Jun 11 '24 11:06 verboEse

@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.

Littlericket avatar Jun 12 '24 07:06 Littlericket

Heyhey, I'm no longer active in this project.

@raviks789 might be a better person to ask!

theFeu avatar Jun 12 '24 09:06 theFeu

@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.

raviks789 avatar Jun 12 '24 09:06 raviks789