How do you configure Jira to use OAuth with a generic application, specifically Jenkins?

Logan G Hawkes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 29, 2012

I'm trying to integrate Jira 4.4.3 with Jenkins 1.456 and I'm completely stuck. Jenkins keeps getting a 403 error when it tries to communicate with Jira. This is odd because both are using the same Crowd server for authentication, hosted on the same server as the Jira instance.

I've tried adding an Application Link between Jira and Jenkins, but the process baffles me. Jenkins can only be added as a generic application using OAuth for incoming authentication. I have been unable to get Jira to accept a Public Key for the Jenkins app. What little information I've found suggests that the Public Key should be a standard 1024-bit RSA public key generated with sha1. I generated a public key for the server but when I paste it into Jira's Oauth configuration screen I always get this error: "Must be a valid public key. java.security.InvalidKeyException: IOException: algid parse error, not a sequence".

Another issue is that I have been completely unable to figure out how to obtain a Consumer Key from the Jenkins application. I am starting to suspect that Jenkins simply doesn't support OAuth.

4 answers

9 votes
beeplogic May 30, 2012

I kept getting the invalid key error as well until I stumbled upon this tutorial:

https://support.desk.com/customer/portal/articles/376008-connecting-desk-com-to-your-jira-integration

Which provided the following example on creating the keys:

openssl genrsa -out jira.pem 1024
openssl rsa -in jira.pem -pubout -out jira.pub

George Mauer October 18, 2016

This article no longer says anything of the sort

2 votes
Chris Bunney July 28, 2015

@beeplogic's command worked for me for setting up a generic OAUTH application link on JIRA v6.5-OD-08-001

1 vote
KushalK July 28, 2015

I am having the same issue. @beeplogic's solution didn't work. Were you able to resolve the issue?

0 votes
Daniel Holmes June 19, 2018

Would this process be similar for Bitbucket?

Suggest an answer

Log in or Sign up to answer