getsentry / sentry-jira

A Plugin for sentry that lets you create JIRA issues
Other
95 stars 32 forks source link

OAuth authentication support #91

Open bsergean opened 8 years ago

bsergean commented 8 years ago

Hi there,

It would be very valuable to have a way to authenticate with OAuth when creating jiras. The sentry bitbucket integration seems to handle this, so I wonder if some code from there could be re-used.

We might try to implement this ourself if we are given some basic directions, and at least some info on whether OAuth is applicable for this plugin (I'm not super familiar with how OAuth works or what it would prevent/allow).

Thanks !

dcramer commented 8 years ago

It's a bit complex today as OAuth is handled via 'django-social-auth', which is a mostly deprecated system inside of Sentry. In the future we plan to refactor integrations to make things like this easier.

Duologic commented 8 years ago

The Jira package on PyPi helped me out a few days ago getting OAuth up an running with a Python application: http://pythonhosted.org/jira/#oauth

It would be great to see it implemented in this plugin.

Protip: the jirashell command was very helpful in configuring it fast:

Generate an rsa key for Jira:

openssl genrsa -out jira.pem 1024
openssl rsa -in jira.pem -pubout -out jira.pub

Create an application link with a consumer key and the jira.pub file:

https://<org>.atlassian.net/plugins/servlet/applinks/listApplicationLinks

Then get oauth tokens with jirashell from jira and follow instructions:

jirashell -s https://<org>.atlassian.net -ck <consumer_key> -k jira.pem -od -pt