How does implement 2-legged OAuth with Jira by jra-ruby gem?

I’m trying do it as follow

options = {
  private_key_file: 'rsakey.pem',
  consumer_key: 'my_consumer_key',
  site: 'http://localhost:2990'
}
@jira_client = JIRA::Client.new(options)
@jira_client.set_access_token(nil, nil)
@jira_client.Issue.find('KEY')

but I get

JIRA::HTTPError: Unauthorized

In Jira Application Links I set

Allow 2-Legged OAuth: true
Execute as: MY_USER

3-Legged oauth work fine.


Source: ruby

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.