Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,681
Community Members
 
Community Events
184
Community Groups

Hi Community,

 

we´re building simple Python scripts for JIRA using the REST API with Basic auth (this way is ok for us, no need for Oauth at the moment).

For building the correct codes we´re using SOAP UI before we implement it in our scripts.

 

When we start execution, for example GET on https://jira.ourdomain.com/rest/api/2/applicationrole we see an error 401 Unauthorized (401). After some tries we get an error 403 and CAPTCHA is active for this user .

So it´s seems that data was correct and the username can be extracted from base64 encoded string by JIRA (base64 string is username:password).

In the past this way worked fine.

 

The same credentials (base64) work perfect in Confluence with REST API, so it seems to be a problem on JIRA side. In the backend both systems use Crowd with the same user directory (LDAP).

We´re using JIRA 8.6.1 with reverse proxy and activated SSL.

 

Regards

Uli

1 answer

1 accepted

0 votes
Answer accepted
Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 07, 2020

Dear @BayWa IT Workplace Atlassian ,

The documentation says: 403: Returned if the current user is not an administrator.

Do you have the proper permissions for your calling user?

So long

Thomas

Hi Thomas,

 

thank you for your answer, first we see an error 401,2020-02-11_07h26_02.png

The used basic auth base64 string ist correct.

The 403 is shown after some tries when CAPTCHA is enabled.

User login data is correct, we use the same for Confluence basic logins (same Crowd directory). All users have full admin rights in JIRA, so it can´t be a permission problem.

 

Regards

Uli

Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 12, 2020

Have you set all headers like described in the API and tutorials?

@Thomas Deiler I tried it once again (I imported the WADL too)

 

This call won´t work (error 401) 

2020-02-13_08h15_12.png

 

This call works, I used the same authorization credentials for both calls.

2020-02-13_08h15_20.png

 

My user has full admin rights in JIRA and all projects.

 

Regards

Uli

Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 13, 2020

Dear @BayWa IT Workplace Atlassian ,

have you tried to use "curl" to verify if if it works in general? Or take a rest client that is offered as a extension for browsers.

So long

Thomas

Hi @Thomas Deiler ,

 

with curl based on this example https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/ it works.

curl \
   -D- \
   -u charlie:charlie \
   -X POST \
   --data {see below} \
   -H "Content-Type: application/json" \
   http://localhost:8080/rest/api/2/issue/

Now I have to try to implement it in Python script.

Regards

Uli

Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 15, 2020

Dear @BayWa IT Workplace Atlassian ,

have you tried this page?

So long

Thomas

@Thomas Deiler I was able to implement my REST calls in Python too.

My problem is fixed now, thank you for you support!

Omprakash Thamsetty
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Feb 20, 2020

@BayWa IT Workplace AtlassianI have the same kind of requirement. Python is trying to curl the JIRA ticket from inside the Docker container and receiving following error messages. Look like needs to pass the CAPTCHA or TOKENs

Any help much appreciate on using curl in python

403

X-Seraph-LoginReason: AUTHENTICATED_FAILED set-cookies JSESSIONID=jira URL

when I login into Jira with that ID and accept the CAPTCHA then got following error.

 

401

X-Seraph-LoginReason: AUTHENTICATED_FAILED, www-authenticate OAuth transfer-Encoding chunked  ...

@Omprakash Thamsetty I don´t use curl in python.

I use requests library, that work´s great for me now.

It was the easiest way for me to add JSON data and headers to my REST calls.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events