jira icon indicating copy to clipboard operation
jira copied to clipboard

OAuth2 (3LO) authentication

Open aradnaev opened this issue 4 years ago • 5 comments

Is your feature request related to a problem? Please describe. OAuth2 (3LO) authentication is wanted that was recently supported by Atlassian: https://developer.atlassian.com/cloud/jira/platform/oauth-2-authorization-code-grants-3lo-for-apps/ Currently only OAuth is supported by this wonderful python package: https://jira.readthedocs.io/en/latest/examples.html#oauth

Describe the solution you'd like Pass a dict of OAuth2 properties to the oauth2 constructor argument:

oauth2_dict = {
    'access_token': 'foo',
    'cloudid': 'abcd-1234-ffff'
}
auth_jira = JIRA(oauth2=oauth2_dict)

Describe alternatives you've considered Tried using existing oauth method with dictionary of oauth2 properties, which as expected did not yield proper authentication (only anonymous level)

Update: found a workaround:

options = {
    'server': 'https://api.atlassian.com/ex/jira/{cloudid}',
    "headers": {         
        'Authorization': 'Bearer {access_token}'
               }            
           }
j = jira.JIRA(
    options=options)

aradnaev avatar Oct 08 '19 21:10 aradnaev

found a workaround:

options = {
    'server': 'https://api.atlassian.com/ex/jira/{cloudid}',
    "headers": {         
        'Authorization': 'Bearer {access_token}'
               }            
           }
j = jira.JIRA(
    options=options)

aradnaev avatar Oct 09 '19 18:10 aradnaev

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You way want to consider using the Sponsor button in order to persuade someone to address it.

stale[bot] avatar Jan 07 '20 19:01 stale[bot]

The workaround shared by @aradnaev is how OAuth2 should be handled or is there some other way?

albertocavalcante avatar Nov 23 '21 18:11 albertocavalcante

The workaround shared by @aradnaev is how OAuth2 should be handled or is there some other way?

IOR88 avatar Sep 19 '23 21:09 IOR88

Is there any solutions supported officially? I found that only oauth 1.0a is supported now. The related doc can be found here.

Hydrion-Qlz avatar Jan 25 '24 10:01 Hydrion-Qlz