How do I develop a plugin with OAuth authentication calls to the REST API ?
So far my plugin is able to use cookies to authenticate a non crowd and a crowd user (basically just plonk all cookies onto the request). But, I also want my plugin to work with JIRA instances configured with OAuth. Is there a straightforward guide to such a thing somewhere ?
I have already looked through https://developer.atlassian.com/server/jira/platform/oauth/?_ga=2.200576488.792104478.1538961913-342920179.1532410874 and https://bitbucket.org/atlassian_tutorial/atlassian-oauth-examples/src/3f0d22c5b1d8749fae6f05aa3556ca8ac3724b5a/java/src/main/java/com/atlassian/oauth/client/example/?at=default and they are not really solving the problem. As the fundamental problem of passing the keys on to the plugin is impossible without a properties file.
Active Objects are out of the question.
The way jira eco system deals with a properties file to a plugin is not sensible either - if I am making a plugin that any JIRA user should be able to use - its unreasonable for me to ask them to shove the properties file in a classes folder which they may or may not have access to.
All I want is for my plugin to work in Jira irrespective of local, crowd or OAuth setup. I got the first two cases covered. Any help please ?