The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Bob Laviguer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 20, 2019

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: "java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: 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 config.properties file as per the sample code. Any thoughts would be welcome!

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events