Two-step OAuth between plugin and Jira Server

I am trying to authorize my plugin to use the Jira Server REST APIs, by creating an OAuth access token.

I tried to use the documented OAuth 3-step process (OAuth), but there is no way to programatically capture the verification code (which is shown on a web page) in the plugin. So I cannot make the final call to get the access token, because of the lack of the verification code “secret”.

Has anyone been able to acquire a request token, and then exchange that for an access token, without the intervening page asking a 3rd party to authorization of this access token?

Regards,
Gordon

If you’re writing a plugin - why do you need to use oAuth against Jira? Couldn’t you just use AppLinks? Application links

The plugin needs to use the REST API calls to Jira, proxying requests from an external service.

According to the AppLinks docs, the usage is to link Atlassian applications together. That’s not the intent of this plugin.