Skip to main content

Python library for Jira OAuth

Project description

jira-oauth

License PyPI - Python Version PyPI

Python library for Jira OAuth

RSA private and public key creations

  • Create RSA private key and store it in file oauth.pem
$ openssl genrsa -out oauth.pem 1024
  • Create RSA public key and store it in file oauth.pub
$ openssl rsa -in oauth.pem -pubout -out oauth.pub
  • Share RSA public key oauth.pub with your Jira Admin, as they need it during Jira Application Link creation.

Jira Application Link Creation Steps

  • Login as a Jira administrator
  • Go to Application links section under Application area
  • Enter dummy url (as oauth token used for API access and not web access) https://jira-oauth1-rest-api-access
  • Click on Create new link button
  • Click Continue on next screen
  • Enter something like Jira OAuth1 REST API access as a Application Name
  • Check Create incomindg link checkbox.
  • Don't need to fill any other information. Click on Continue
  • Now you should able to see new Application link with name Jira OAuth1 REST API access created and available under section Configure Application Links section
  • Click on pencil icon to configure Incoming Authentication
    • Enter jira-oauth1-rest-api-access (or any other appropriate string) as Consumer key
    • Enter same string jira-oauth1-rest-api-access (or any other appropriate string) as Consumer Name
    • Enter content of RSA public key (stored in file oauth.pub) as public key
    • Click on Save

Prepare for OAuth Dance

Create starter_oauth.config in ~/.oauthconfig folder:

[oauth_config]
jira_url=https://jira.example.com
consumer_key=jira-oauth1-rest-api-access
test_jira_issue=IDEV-1

Perform Jira OAuth Dance

  • Python Virtual Environment that we create earlier is active.
  • Run jira-oauth.
  • Authenticate in browser as directed below.
  • After successful OAuth generation, you will get another set of values for oauth_token and oauth_token_secret. These are you tokens that you need to use access Jira without passing credentials.
$ jira-oauth
Request Token: oauth_token=6AOSSREyS9HaACqEcHjcD6RJVms2NjEr, oauth_token_secret=gnpJMfbgUyG8W4dKzFW4PKFbGttV2CWm

Go to the following link in your browser: https://jira.example.com/plugins/servlet/oauth/authorize?oauth_token=6AOSSREyS9HaACqEcHjcD6RJVms2NjEr
Have you authorized me? (y/n) y

Access Token: oauth_token=lmOh7LEdvZ2yxKIm5rdQY2ZfZqNdvUV4, oauth_token_secret=gnpJMfbgUyG8W4dKzFW4PKFbGttV2CWm
You may now access protected resources using the access tokens above.

Accessing IDEV-1 using generated OAuth tokens:
Success!
Issue key: IDEV-1, Summary: Internal Devepment Issue #1

Run with Docker

cp -R ~/.oauthconfig ./
docker build -t jira-oauth .
docker run -p 8080:8080 -it --rm jira-oauth

Credits

Thank you, Raju Kadam, for implementing https://github.com/rkadam/jira-oauth-generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jira-oauth-0.1.12.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

jira_oauth-0.1.12-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file jira-oauth-0.1.12.tar.gz.

File metadata

  • Download URL: jira-oauth-0.1.12.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.7.9 Linux/5.8.7-1-default

File hashes

Hashes for jira-oauth-0.1.12.tar.gz
Algorithm Hash digest
SHA256 1e152d88e86d1796b336d27f77e6b489e0693b163a13e0292dd02efd1b4a2319
MD5 590bc63b94f96911bb45a449beead56b
BLAKE2b-256 3e0ee812a6970ac0292b204cadb39ccd8e7862df0057364db36cd418d9ac8999

See more details on using hashes here.

File details

Details for the file jira_oauth-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: jira_oauth-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.7.9 Linux/5.8.7-1-default

File hashes

Hashes for jira_oauth-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 65192fa17f5e8cd7dcb5af17afaafe411da147449414633aa0130bfd285ae57f
MD5 914e05f28b85c6e638436bdc344111d0
BLAKE2b-256 682b1e76dffd8e35a17970291157d86eaf6af3ad9627644cf8029c86d5973fb7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page