Latest version
Close
Latest version
Close
Close
- First, setup JIRA: Generate RSA public/private key pair (you end up with rsa.pub and rsa.pem files). Your Python code will need access to the private key rsa.pem. Configure a JIRA application (done in JIRA admin under 'Application Links') with 'Incoming Authentication' and use the public key generated above.
- The client holds on to the private key (generated) and the consumer key (made up). JIRA requires the consumer key (made up) but also the public key (generated with the private key) and JIRA needs no knowlege of the private key itself, hence it's called private.
- Here we describe one way to do the 'oauth dance' to generate a trusted token using Python 3 - specifically the jirashell utility from the jira Python package. Jirashell then forms a useful basis for a Python script. Our example script uses OAuth to call an undocumented REST API for querying license data.
Released:
Jun 18, 2015 Hi Joseph! generate oauth token for JIRA users OAuth Request and Access tokens are returned by Service provider (i.e. Probably you want to generate public and private keys. For Jira Server. Jira Server does not have the same kind of API tokens that can be created for Atlassian Cloud products. There are tokens that can be created, but these are OAuth tokens. The use of OAuth tokens requires that you utilize a programming library in a language such as Java, perl, python, nodejs, etc in order to make these calls.
Python library for Jira OAuth
Project description
Python library for Jira OAuth
RSA private and public key creations
- Create RSA private key and store it in file oauth.pem
- Create RSA public key and store it in file 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:
Jira Create Api Token
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.
Credits
Thank you, Raju Kadam, for implementing https://github.com/rkadam/jira-oauth-generator
Release historyRelease notifications
0.1.10
Jira Oauth Generate Public Key Git
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size jira_oauth-0.1.10-py3-none-any.whl (25.6 kB) | File type Wheel | Python version py3 | Upload date | Hashes |
Filename, size jira-oauth-0.1.10.tar.gz (10.1 kB) | File type Source | Python version None | Upload date | Hashes |
Jira Oauth Generate Public Key Ssh
CloseHashes for jira_oauth-0.1.10-py3-none-any.whl
Algorithm | Hash digest |
---|---|
SHA256 | 7d9ac84f5b5a3f75c405b8cbd75d9edecd0c1d195db2cf24073933deb10a23b6 |
MD5 | a03a5ff58115fb11a7260a4ec1501c0a |
BLAKE2-256 | 88ba0a94d9e4480a4bf8d96f1e22f57a4a4775cc9fa1bf0d2ceb6112c5580212 |
Hashes for jira-oauth-0.1.10.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | 8f85b72679faa87ea682d9ddbcda1e2f3fa14127425e3cf8deca5680c979430a |
MD5 | 86e674f3dd89c9ca47ee9da8d7d5df28 |
BLAKE2-256 | 174a9715a4f4c1646ade74556f802d3e08cae81aca91ce31cb321c2240d997c8 |
Released:
Generator of access token for Jira OAuth
Project description
Python 3 Setup
- Create Python 3 Virtual Environment
- Activate this environment to work on
- Install all required libraries
RSA Private and Public Key creations
- Make sure you have .oauthconfig folder exists in your home directory
- Create RSA Private key and store it in file oauth.pem
- Create RSA Public Key and store it in file oauth.pub
- Again make sure both files are copied to .oauthconfig folder in your home directory.
- Also share RSA Public Key oauth.pub with your Jira Admin, as they need it during Jira Application Link creation.
Jira Application Link Creation Steps
- Logon 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
- 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:
- Make sure you are in base directory of this Repo
- Python Virtual Environment that we create earlier is active.
- Run jira_oauth_token_generator.py
- Authenticate in browser as directed below and then click y for question Have you authorized me?
- 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.
Copy both oauth_token and oauth_token_secret to .oauth_jira_config.<jira_env> file.
Using OAuth1 tokens in Sample Jira Script.
- Using Python Requests library
- Using Python JIRA library
Original implementation is available here:
https://bitbucket.org/atlassian_tutorial/atlassian-oauth-examples under python/app.py
Release historyRelease notifications
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size jira_oauth_generator-0.1.7-py3-none-any.whl (18.6 kB) | File type Wheel | Python version py3 | Upload date | Hashes |
Filename, size jira-oauth-generator-0.1.7.tar.gz (7.8 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for jira_oauth_generator-0.1.7-py3-none-any.whl
Algorithm | Hash digest |
---|---|
SHA256 | 19b1023fe322610f3ebfb3d038c3471a8aa771e5cd622906765601ab3467a9f0 |
MD5 | 34a03e6173fb2ab90340db1f5677adb6 |
BLAKE2-256 | e9c38dbef344fc6ef4ababb4e789cd5a18921c1ec8a34e1f21d6aad54f2a4d6d |
Hashes for jira-oauth-generator-0.1.7.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | ce6ef7baaa7eb9b877c3935b607e60750d0e2517e2a211654220919fc05bb2be |
MD5 | 0882b87faba791bae86304b73aab9cac |
BLAKE2-256 | 2eb8d087d7e1e77454cda3841e283909f1b7aa5ba63ce33d072fe0f7a4ccae8d |