jiracli icon indicating copy to clipboard operation
jiracli copied to clipboard

Unauthorized

Open vervaekejonathan opened this issue 9 years ago • 3 comments

I'm redirected to the Unauthorized page when the script tries to load "https://server_name/rest/api/2/serverInfo"

I'm pretty confident my .jiracli.ini file is correctly set. Could this have to do with an requirement that I'm missing?

TRACEBACK: File "/github/jiracli/myenv/bin/jiracli", line 11, in sys.exit(main()) File "/github/jiracli/myenv/local/lib/python2.7/site-packages/jiracli/init.py", line 409, in main jira_obj = jira_obj_get(conf) File "/github/jiracli/myenv/local/lib/python2.7/site-packages/jiracli/init.py", line 128, in jira_obj_get return JIRA(options, basic_auth=(conf['user'], conf['password'])) File "/github/jiracli/myenv/local/lib/python2.7/site-packages/jira/client.py", line 219, in init si = self.server_info() File "/github/jiracli/myenv/local/lib/python2.7/site-packages/jira/client.py", line 1504, in server_info return self._get_json('serverInfo') File "/github/jiracli/myenv/local/lib/python2.7/site-packages/jira/client.py", line 1894, in _get_json r = self._session.get(url, params=params) File "/github/jiracli/myenv/local/lib/python2.7/site-packages/jira/resilientsession.py", line 78, in get return self.__verb('GET', url, *_kwargs) File "/github/jiracli/myenv/local/lib/python2.7/site-packages/jira/resilientsession.py", line 74, in __verb raise_on_error(r, verb=verb, *_kwargs) File "/github/jiracli/myenv/local/lib/python2.7/site-packages/jira/utils.py", line 120, in raise_on_error r.status_code, error, r.url, request=request, response=r, **kwargs) jira.utils.JIRAError: JiraError HTTP 401

    text: 
Unauthorized (401) [more html code] url: https://_server_name_/rest/api/2/serverInfo

vervaekejonathan avatar Jul 13 '15 09:07 vervaekejonathan

@vervaekejonathan maybe your server doesn't allow basic auth? oauth is currently not usable from jiracli. I'll try to fix that.

toabctl avatar Aug 07 '15 20:08 toabctl

I tested with "tickets.puppetlabs.com" and that worked for me.

toabctl avatar Aug 07 '15 21:08 toabctl

fyi I had the same issue but it turns out my username is admin and I was using my email address thinking they were interchangeable :P

jtmarmon avatar Feb 29 '16 17:02 jtmarmon