JIRA OAuth Configuration

keineantwort December 3, 2012

I am trying to file Tickets with a Google Docs Script using OAuth authentification. But I am stuck in the configuration.

I did configure an application link with an incoming authentication. I did set the Consumer Name, the Consumer Key and the Public Key.

Now I am trying to access JIRA from my Google Docs Script using the URLFetchApp class. I can register an oauth configuration. I did set all the URLs:

AccessTokenUrl: http://myhost/plugins/servlet/oauth/access-token

requestTokenUrl: http://myhost/plugins/servlet/oauth/request-token

authorizationUrl: http://myhost/plugins/servlet/oauth/authorize

But what do I have to set as Consumer Key and especially Consumer Secret? I used the Value of Consumer Key as Consumer Key. Sounds good. But I don't know what to use as Consumer Secret. Neither the Public Key, the matching Private Key nor the Consumer Name worked. The bad thing: I cannot get a proper Error Message from the Google Docs Script.

4 answers

2 votes
William George January 10, 2013

Martin,

Did you ever fix this issue. Atlassian is terrible for documentation on this, so i thought i would share my thoughts after trying to implement it for the last 10 hours. It is my first time at oAuth and experienced users might have known from the outset that because JIRA uses RSA-SHA1 signing, you do not need a consumer secret key. Wow so that would have been nice to know...

I tried everything you had done too.

Basically i want to leave an answer as i stubbled across this whilst stuggling myself and would have saved a lot of time if somebody actually made the effort to help.

Remeber that Private key you have? This needs to be used to sign the request that gets sent to the JIRA server. JIRA then uses the public key you gave it to decode the request and boom you have made the connection.

If you are using (like me) the oauth-php source downloaded from googlecode. It includes the functionallity to sign your requests using RSA-SHA1 but its not fully implemented. All i did was find the class and where it calls the Private Key, paste it in.

Now i can make requests like a breeze and it only took all *sigh* day.

Hernan Montes May 19, 2013

can you provide a sample code of your implementation, i already use oauth-php library but can't get it to work!!

2 votes
LucasA
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.
December 3, 2012

Hello,

When setting up OAuth authentication in JIRA, you will need a certificate file to perform the "OAuth dance". If Google Docs didn't provide it, you can create a certificate file using OpenSSL and apply it for both -- JIRA and Google Docs. It will be your Public and Private Keys.

Best regards,
Lucas Timm

keineantwort December 3, 2012

Hi Lucas,

thanks for your answer. I did create a Key-Pair and pasted the Content of the public-key file (without ----- BEGIN PUBLIC KEY ----- and ----- END PUBLIC KEY ----- and linebreaks) into the public key field in JIRA. But at Google Docs side I cannot provide a key-file. I can provide a "Consumer Key" and a "Consumer Secret". So. What's the Key and what's the Secret? And why can I configure 3 fields "Consumer Key", "Consumer Name" and "Public Key" in JIRA? How do these filds match?

Best regards, Martin

0 votes
Kourosh Saleh September 24, 2013

Hi William, I have same problem, I have private key and I need to use it with consumer key to implement OAuth on Jira. is it possible for you to show the code? thanks.

0 votes
Hernan Montes May 19, 2013

Hello William, can you show an example of your implementation, i've been banging my head to the desk for a couple of days, so far i've got the request token :(

Suggest an answer

Log in or Sign up to answer