Oauth Jira authentication client issue when requesting token with OAuthTutorialClient-1.0.jar

I’m trying to authenticate my java application against the JIRA REST API using OAuth (1.0a as OAuth 2.0 is not supported).

For this purpose, I’m trying to complete first of all the guide provided by atlassian at: https://developer.atlassian.com/server/jira/platform/oauth/

However, I can´t move on from Step 2. Do the “OAuth dance”. When executing java -jar OAuthTutorialClient-1.0.jar requestToken I’m getting the following error output:

com.google.api.client.http.HttpResponseException: 400
oauth_parameters_absent=oauth_consumer_key&oauth_problem=parameter_absent
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1070)
at com.google.api.client.auth.oauth.AbstractOAuthGetToken.execute(Abstrac
at com.atlassian.oauth.client.example.JiraOAuthClient.getAndAuthorizeTemp
at com.atlassian.oauth.client.example.OAuthClient.handleGetRequestTokenAc
at com.atlassian.oauth.client.example.OAuthClient.execute(OAuthClient.jav
at com.atlassian.oauth.client.example.ClientMain.main(ClientMain.java:18)

It seems to me there is an issue with my private/public key despite I have followed every previous step showed in the guide. Moreover the error message doesn’t provide any more details besides the above.

My config.properties file looks like this:

#Mon Mar 26 19:41:28 CEST 2018
jira_home=https://jira.myserver.com
consumer_key=OauthKey
private_key=MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBANRno34rGDJ48PkMdVKH/48g2Gvjn4ACSmppXXtUZ59Mk6PO2OB/iF5Z3XS5yO9Dsyj1UzVR0TtWCUAHMYlSRNCvEhsG7g31snKh+bn6TbVYpzvDgKV7V64juWZkadC3tQcljwMBVSRTV5TBDLuyvqyl0NKqbyBdhtnJCqpK1rUPAgMBAAECgYBLs/yDdVyUcKKCQTx3g91D6BL6sRAiEa7wKkmVMUoVbreYRJrruMijyCez+JtzG4/5Yyaa9GQ8X7fASFARf27iw3qeHtcZyQjcCHzEg6vNd9jMOcr4aGh5dnNK0qVoEvVuIf38yw2Kdrhch++Xy4T/8qwFiuaaOabqhg73ZUiDYQJBAPR9OkremW4pySs2wMhxwigW0JOKnZUgGRjK1UHKqvqJjrherEo1MP0btZ1cQdvUyCa0Q8TCgZ9eR/DFy+pNQrkCQQDeZ7SulproyM8mqIb9B33sWN+YqIVJZN6jjOaZy+ZHBzQLHmv3TU7C0KB3v/9+WXKa/mT0Zxm1noSBx49PX/IHAkEA8GpYMRlVrPOgI0NzLWhX8U4GCp/LN8JZi3yhWlHt8fHkiz5lk49cvfhKjhQTmxVRQGYRIeHWzx1KBuSqEZup2QJBAKULHKA7DzYUXvV3NsVq292ajkOBO3gdrMJ9+1rCX17yT4K4zrI04m/b1llHV9hxlITEqDJemEuZGQgeCZGDx90CQQDL504bCmx3aXeNLQheVkzmJdyjaRfxrgycVSNgRPMeqR7fK2+taaOp9cDfYPTiu+y4RSFdigCJBd3PaT41DL5H

Anyway, my ultimate goal is to authenticate my java application against the JIRA REST API using OAuth, hence I need to know how to get the access token.

Could you please help on this?

I am having the same problem

Hello @jorge.amatro,

In your config.properties, for jira_home (since you’re using a server deployment), kindly append /jira. Also, I use http instead of https (which works on my setup), so your jira_home entry will look like jira_home=http://jira.myserver.com/jira.

Just to be on the safe side, make sure that private_key does not have any linebreaks.

Cheers,
Ian

Hi @jorge.amatro

Were you able to find a solution?
I have the same concerns.

Thank you,

@jorge.amatro/@sofia.skubiy, did you find a solution?

The message error from JIRA is very poor. It’s says “oauth_parameters_absent=oauth_consumer_key&oauth_problem=parameter_absent” for almost anything you configure wrong in the call. not just if forget to pass the consumer key.

Some problems that I came across and resulted in that error:
1- Wrong private key
2- Spaces in private key
3- Wrong consumer key
4- Wrong url
5- The public key configured in the application link and the private key sent doesn’t match

It’s very sad to see such a big API service of a giant organization have this basic issue of not specifying the exact error occurred.