OAuth 1.0a REST API Authentication Error: Invalid Signature

When attempting to authenticate with the REST API I receive an invalid signature error. I’m passing the below as my base string:


And then signing it using a shared cert that I have set up in the application links section. Since I am getting a decrypted string back from JIRA I’m confident that I have configured my application link correctly. Below is what JIRA Returns:

18:35:11:202 USER_DEBUG

&oauth_signature=<redacted because apparently atlassian doesn’t want me to put this in the question>



This is my first time working with OAuth. I was able to get the REST API Working with basic authentication, I just want something more secure.


I found this https://confluence.atlassian.com/applinks/troubleshoot-application-links/oauth-troubleshooting-guide#OAuthtroubleshootingguide-OAuthinvalidsig a while back and at first I discounted it as it didn’t seem like it could be the cause.

I used requestb.in/vyqrg1vy?inspect (note this page will only be active for like 48 hours) and was able to determine that no referer was being passed. I set this manually in the header:

req.setHeader(‘Referer’,’ gnerb-dev-ed.my.salesforce.com/exec-anon’);

And the error still persisted. From what I can tell, the referer header is the primary way http determines the URI of the application making the request. Is this not correct? What other method would the server be expecting the URI to be provided?

I removed the HTTP from some of the url’s as the community automatically converted them to links and I can’t have that many links.

Just so we are clear: did you follow the steps on this page: https://developer.atlassian.com/cloud/jira/platform/jira-rest-api-oauth-authentication/?

And at which step did the above error happen?

Yes I have followed those steps. Unfortunately, document is only for Java and is using a Google API. This makes it especially difficult to track down the code that is building the HTTP request.

The error happens when I request a request token from the JIRA server.

1 Like

Agreed with @everything , document have only java integration example and is using a Google api. If you @pvandevoorde , could provide some proper doc or and reference so that we can use the follow in other language too.

Doc like, what will be the payload for which post request.

Example - Making a POST request on https://{project}.atlassian.net/plugins/servlet/oauth/request-token expect payload like


and Rather than that I am getting this :disappointed_relieved:

Error - net.oauth.OAuthException: java.security.SignatureException: Signature length not correct: got 632 but was expecting 128

here is the image -

Are you passing the correct parameters in ConsumerKey and ConsumerSecret?

The ConsumerKey should be equal to OauthKey and the ConsumerSecret should be your generated Private Key, including the first and last lines.

Also, even though the documentation told me to copy the private key from the .pcks8 file, I only managed to generate the request key and access key when using the contents of the .pem file.

The docs for this type of authentication are terrible, and contains many mistakes. After a lot of struggle, I managed to generate the access key, but I still have not managed to use it to access a protected resource on the API.