1
votes

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?

1

1 Answers

0
votes

I didn't get the guide example working, no answer from atlassian neither. However I could get my goal of getting my java application connected to jira via rest client thanks to the following resources:

https://github.com/lisanlai/jira.oauth.client (in order to generate the access token)

https://community.atlassian.com/t5/Questions/Access-to-JIRA-ressource-using-com-atlassian-jira-jira-rest-java/qaq-p/705465 (in order to set up oauth in the jira rest client)

OAuth authentication in jira by using Java (same as before, just from other point of view)

Just in case it helps to anyone.