Jira oauth error signature length not correct

Hey!

Currently iam developing a little Jira notification tool in C# for Jira events that i can configure in my tool. To get the information from jira i contact the rest api.

In the first step i implemented basic authentication. so i have to send the users credentials als base64 with each request to rest api. Thats working perfectly.

To make it a bit more safe i would like to implement oauth.

I have never used oauth before and i have a little problem with constructing the request.

In first step i want to ask for a request token.

So i created a basestring with the encodedurl and the oauthparameters.

Like this:

POST&https%3A%2F%2Fdevjira.ad.hygi.de%2Fplugins%2Fservlet%2Foauth%2Frequest-token%26oauth_consumer_key%3Dhardcodedtestkey%26oauth_signature_method%3DRSA-SHA1%26oauth_timestamp%3D1496215211%26oauth_nonce%3DNjM2MzE4MTkyMTE2MjY0ODMw%26oauth_callback%3Doob

Here iam using consumer key, signature method, timestamp, nonce and callback, but i also tried combos without callback and with oauth_version.

With this example i created rsa-sha1 signature using the bouncycastle library.
My authorization header looks like this: (i used public and private key from the example you can find here
https://bitbucket.org/atlassian_tutorial/atlassian-oauth-examples)
Now my authorization header looks like this:

{
Authorization: OAuth oauth_consumer_key="hardcodedtestkey", oauth_signature_method="RSA-SHA1", oauth_timestamp="1496215211", oauth_nonce="NjM2MzE4MTkyMTE2MjY0ODMw", oauth_callback="oob", oauth_signature="HtlcgkFjR24obsW6yUAV9czhUelq1/htBaJjxjeNEKx1H+I6aYOYXgthHBt8/NDtqWHi+KHoa1nV7raWoVMMGz6kwSqZ3q+66ULN1YBRmxHRiXwsDllqZOkgjwG3bbxjtWBpmWrouXbsUNk/sQwZ/XG7h0oljcLFltwAzTsHp6E="

}

When calling the request token url i get error 500 and logs say "signature length not correct" got 127 expecting 128.

Do you have any idea what iam missing or doing wrong?
Iam right with the oauth-parameter for version being optional? tried with it but still getting same error.
i appreciate your help!

0 answers

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,789 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot