consumer_key_unknown

srinivasp
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 12, 2014

I created Generic application link using a dummy rul my.test.rul to test rest client using oauth. To get the request token i have executed the below command from the commandline which ws mentioned in the documentation

java -jar rest-oauth-client-1.0.one-jar.jar requestToken JIRA_BASE_URL CALLBACK_URL

I got the below error message. What is wrong I am doing here? Can some one suggest please?

C:\Srinivas\jira rest client jar>java -jar rest-oauth-client-1.0.one-jar.jar requestToken "http://jirabaseurl.xxxxx.com"  "http://my.test.url"
Jun 12, 2014 4:18:15 PM org.apache.http.impl.client.DefaultRequestDirector handleResponse
WARNING: Authentication error: Unable to respond to any of these challenges: {oauth=WWW-Authenticate: OAuth realm="http://jirabaseurl.xxxxx.com", oauth_problem="consumer_ke
y_unknown"} Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.simontuffs.onejar.Boot.run(Boot.java:340) at com.simontuffs.onejar.Boot.main(Boot.java:166) Caused by: java.lang.RuntimeException: Failed to obtain request token at com.atlassian.oauth.client.example.AtlassianOAuthClient.getRequestToken(AtlassianOAuthClient.java:66) at com.atlassian.oauth.client.example.JIRAOAuthClient.main(JIRAOAuthClient.java:52) ... 6 more Caused by: net.oauth.OAuthProblemException: consumer_key_unknown at net.oauth.client.OAuthResponseMessage.toOAuthProblemException(OAuthResponseMessage.java:83) at net.oauth.client.OAuthClient.invoke(OAuthClient.java:306) at net.oauth.client.OAuthClient.invoke(OAuthClient.java:260) at net.oauth.client.OAuthClient.getRequestTokenResponse(OAuthClient.java:190) at com.atlassian.oauth.client.example.AtlassianOAuthClient.getRequestToken(AtlassianOAuthClient.java:57) ... 7 more

5 answers

2 votes
cesar_del_solar December 16, 2014

You must use the name "hardcoded-consumer" as the consumer key for the app in Application Links. 

tivon zhang April 14, 2015

Thanks. i solved this problem.

Chandan Sharma March 6, 2016

Can you say what is "hardcoded-consumer" ? I am not getting

cesar_del_solar March 6, 2016

Literally that very string, "hardcoded-consumer".

0 votes
cesar_del_solar December 16, 2014

Read the documentation carefully, you must use the name "hardcoded-consumer" as the consumer key. I now get a 500 error instead of consumer_key_unknown, though.. but that's a step in the right direction?

0 votes
SéverineC November 27, 2014

Did you find any solution ?

0 votes
Santhosh Natarajan October 9, 2014

Did you find any solution for this @Srinivas Patruni

0 votes
srinivasp
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 12, 2014

Hi atlassians, Any help please?

Suggest an answer

Log in or Sign up to answer