I want to send REST request to create issues in jira from my java application. So i haven't got problems with sending request, and issue creates perfectly while i create issue through browser(cause if i'm not mistake JIRA use cookies to autorisation) Can anybody give me advice how to implement OAuth jira authorisation in Java? I never did this before i think it's not difficult but i don't know what i need to start. I find this OAuth example and this REST request documentation for JIRA. Can you advice me any doc's about OAuth or any examples with java autorisation.
Thanks in advanced.
Here's my answer to the same question in the Atlassian forum:
It is very hacky but it is compatible with
JiraRestClientFactory
. First follow JIRA REST API Tutorial to get your access token. Read their source code to understand exactly what they do, as my code is based on their code. Their code usesnet.oauth
library. Since this library is not under central maven repository, you need to add its repository to your maven file:Now, we need to combine what the tutorial did to make authenticated requests with the new AuthenticationHandler.
I'm assuming you've been here already, but you can't get much better than the official website for documentation on how it works.
(Ported over from my comment as requested)