It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Get requestToken fails using OAuthClient sample Java code: "invalid key format"

I'm trying to use the Atlassian-supplied "OAuthTutorialClient" for Java, and cannot get the requestToken command to complete successfully against a BitBucket server. I have what I think is a working private key - I can git push from my local directory to the server successfully. However in code, when I execute this line: 

String accessToken = jiraOAuthClient.getAccessToken(tmpToken, secret, properties.get(CONSUMER_KEY), properties.get(PRIVATE_KEY));

I get this error: " invalid key format"

The CONSUMER_KEY value is "OauthKey", and the PRIVATE_KEY value starts and ends with this: "AAABABv1...PH7k2YA==" . Both of these values are stored in the file as per the sample code. Any thoughts would be welcome!

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,086 views 0 5
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you