Fisheye rest status code 403

 

Hello

I have generated authentication token and able to make REST calls from my browser and get response.

Now I am trying to make the same thing work from my python program and I get status code 403

Why is it forbidden?

when I tried both user/pass and token combinations as shown below.

Please let me know.

 

import requests

print "hello world"
# r = requests.get("http://myfisheye:2003",auth=("myuser","mypass"))
# r = requests.get("http://myfisheye:2003/rest-service-fecru/admin/groups?FEAUTH=myuser:1:xxxx50713b31b7859c9c0cd6f19e4568b372e992")
r = requests.get("http://myfisheye:2003/rest-service-fecru/admin/repositories?FEAUTH=modha.k:1:xxxx50713b31b7859c9c0cd6f19e4568b372e992")
print r.status_code

 

Thanks

Abe

2 answers

1 accepted

Accepted Answer
0 votes

Solved:

For anyone who is looking for a solution

 

/rest-service-fecru/auth/login
in conn.request.

 use 

 

I have tried this varient

 

import httplib
import urllib


conn = httplib.HTTPConnection("myfisheye:2003")
args = urllib.urlencode({'userName':'myuser', 'password':'mypassword'})
#args = urllib.urlencode({'FEAUTH':'myuser:1:xxxx50713b31b7859c9c0cd6f19e4568b372e992'})
headers = {'Accept':'application/json'}
r1 = conn.request("post","/rest-service/auth/login",args,headers)

#conn.request("get","/rest-service-fecru/admin/groups",args,headers)
r2 = conn.getresponse()
print r1,r2.status,r2.reason,r2






Got this as response:
====================
/home/myuser/env3/bin/python /home/modha.k/PycharmProjects/mysample/test.py
None 404 Crucible is not enabled <httplib.HTTPResponse instance at 0xc29248>
hello world

Process finished with exit code 0

 

 

I have also added IPAddress of fisheye in Jira user server.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Monday in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

514 views 0 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you