Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Bob Laviguer 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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events