oauth SignatureException: Signature length not correct

Hi, I trying to make OAuth authorization in my PHP app, but I getting following error

JIRA throws an exception when trying to request token 

request headers are:

[

  [Connection] => close

  [Accept-Encoding] => gzip, deflate  

  [User-Agent] => Zend\Http\Client

  [Content-Type] => application/x-www-form-urlencoded

  [Authorization] => OAuth realm="",oauth_consumer_key="key",oauth_nonce="4279f234a0fd4039d7d0309bb1995698",oauth_timestamp="1472486709",oauth_signature_method="RSA-SHA1",oauth_version="1.0",oauth_callback="oob",oauth_signature="%15%AC%BF1y%95%A6r%2F%D9%00%8E%5D%A8%87j%D2%D1%C6%27%0C%0Eg%8D%01v%22B%E1%EF%C8%60%CD%21%F0~%94%C5%8D%FAG%01%FA%EA%3A%24%D5%E7w9%EE%5C%24J%C4P%C0%9E%047%D5%97B%91%15%95%0CB%A6%D5bi~%15%AC%F1%B4t%93%A2%A11%0D%91%9E%E65D%BF%1F%D7%2B%EEV%403u%1E%C3%86%0Ap%EC%18%3A%92A%E6%EDA%9C%87%D5%DFT%E4q%FEl%95S%F4W%14K%A1%19%88"

]

 

response http code 500

and text of exception is:

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


could somone tell what is wrong here?


thx.

1 answer

1 accepted

You should encode your signature as Base64, your signature is in bytes and it stops at the %00 (0 byte, is string end)

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Fadoua M. Boualem
Published yesterday in Trello

Using Trello to manage events

As a Jira power user, I was at first doubtful that Trello could benefit my workflow. Jira already uses boards (ones you can customize!), so why would I even need to use Trello?! In this post you will...

425 views 5 6
Read article

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