Jira OAuth - unable to create application link

I am trying to create an application that uses jira for authentication. I am using the Jira Rest API for the same. The documentation says that to create a link to the application, the same public key and consumer key are used as in the document. This works fine and I can create an access token. But in the Java code, as mentioned in this , I'm not sure what should be given for private_key. I tried two methods-

  1. Generated a random private key using rsa and provided it instead of private_key, which did not work. This gave an exception talking about length too long . I tried on 2048, 1024, 512, 256 and 128 bits. Everything gave the same error.

Application Link:

Consumer Key: Hard Coded Consumer

Consumer Name: hard-consumer

Public Key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxZDzGUGk6rElyPm0iOua0lWg84nOlhQN1gmTFTIu5WFyQFHZF6OA4HX7xATttQZ6N21yKMakuNdRvEudyN / coUqe89r3Ae + rkEIn4tCxGpJWX205xVF3Cgsn8ICj6dLUFQPiWXouoZ7HG0sPKhCLXXOvUXmekivtyx4bxVFD9Zy4SQ7IHTx0V0pZYGc6r1gF0LqRmGVQDaQSbivigH4mlVwoAO9Tfccf + V00hYuSvntU + B1ZygMw2rAFLezJmnftTxPuehqWu9xS5NVsPsWgBL7LOi3oY8lhzOYjbMKDWM6zUtpOmWJA52cVJW6zwxCxE28 / 592IARxlJcq14tjwYwIDAQAB

  1. Generated a pair of private and public keys and provided the same in the application link and in the code, respectively. But in this case, I cannot create an access token. This gives -

Application Link:

Consumer Key: Hard Coded Consumer

Consumer Name: hard-consumer

Public Key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC0YjCwIfYoprq / FQO6lb3asXrx LlJFuCvtinTF5p0GxvQGu5O3gYytUvtC2JlYzypSRjVxwxrsuRcP3e641SdASwfr mzyvIgP08N4S0IFzEURkV1wp / IpH7kH41EtbmUmrXSwfNZsnQRE5SYSOhh + LcK2w yQkdgcMv11l4KoBkcwIDAQAB

 Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) 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: signature_invalid 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) 

Can someone explain to me what should be done? Am I missing something here? And also what is the difference between a shared key, a consumer key, and a public key?

thank you in advance

+7
source share
2 answers

I somehow fixed the problem using the publication, which is presented in the documentation , and the private key, as indicated in the example

But nevertheless, I was not able to create a link to the application with a public and public key.

0
source

The exception is due to the ending of "/" in the base JIRA URL (caused by net.oauth.OAuthProblemException: signature_invalid ).

Correct request:

 java -jar rest-oauth-client-1.0.one-jar.jar requestToken https://jira_base_server_url http://your_redirctedUrl 
0
source

All Articles