Jit icon indicating copy to clipboard operation
Jit copied to clipboard

Setup with Jira Cloud

Open martinffx opened this issue 7 years ago • 4 comments

I'm struggling to get authentication to work with Jira Cloud

If I try run the example curl commands from the code:

$ curl -D- -u martin:password -X GET -H "Content-Type: application/json" 'https://company.atlassian.net/jira/rest/api/2/user?username=martin'
HTTP/1.1 404 Not Found
Server: nginx
Date: Mon, 26 Jun 2017 13:45:54 GMT
Content-Type: text/html;charset=UTF-8
Content-Length: 1667
Connection: keep-alive
Vary: Accept-Encoding
X-AREQUESTID: 945x62874x1
X-Seraph-LoginReason: OK
X-AUSERNAME: martin
X-ATENANT-ID: company.atlassian.net
X-Content-Type-Options: nosniff
Set-Cookie: atlassian.xsrf.token=BYWA-RBOF-27UZ-TBCW|f28d7d2ca5c32baa3ee2a7083d0702e2b5ec2a31|lin; Path=/; Secure
Set-Cookie: JSESSIONID=0513861DA91AFCF6D29A74D5F097B2CE; Path=/; Secure; HttpOnly

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Oops, you&#39;ve found a dead link. - JIRA</title><script type="text/javascript">contextPath = "";</script><link type='text/css' rel='stylesheet' href='/static-assets/metal-all.css' media='all'><script src='/static-assets/metal-all.js'></script><!--[if lt IE 9]><link type='text/css' rel='stylesheet' href='/static-assets/metal-all-ie.css' media='all'><script src='/static-assets/metal-all-ie.js'></script><![endif]--><!--[if IE 9]><link type='text/css' rel='stylesheet' href='/static-assets/metal-all-ie9.css' media='all'><![endif]--><meta name="decorator" content="none" /></head><body class=" error-page error404"><script type="text/javascript">document.body.className += " js-enabled";</script><div id="page"><header id="header" role="banner"></header><!-- #header --><section id="content" role="main"><div class="aui-page-panel"><div class="aui-page-panel-inner"><section class="aui-page-panel-content lowerContent"><div id="error-state"><span class="error-type"></span><h1>Oops, you&#39;ve found a dead link.</h1><ul><li>Go back to the <a href="javascript:window.history.back()">previous page</a></li><li>Go to the <a href="/secure/MyJiraHome.jspa">Home Page</a></li></ul></div></section><!-- .aui-page-panel-content --></div><!-- .aui-page-panel-inner --></div><!-- .aui-page-panel --></section><!-- #content --><footer id="footer" role="contentinfo"><section class="footer-body"><div id="footer-logo"><a href="http://www.atlassian.com/" rel="nofollow">Atlassian</a></div></section></footer><!-- #footer --></div><!-- #page --></body></html>⏎

If I run the example from the jira documentation it works:

curl -D- -X GET -H "Authorization: Basic ZnJlZDpmcmVk" -H "Content-Type: application/json" "http://kelpie9:8081/rest/api/2/issue/QA-31"
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 26 Jun 2017 13:50:48 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
X-AREQUESTID: 950x62931x1
X-Seraph-LoginReason: OK
X-AUSERNAME: martin
X-ATENANT-ID: kelpie9
Cache-Control: no-cache, no-store, no-transform
X-Content-Type-Options: nosniff
Set-Cookie: atlassian.xsrf.token=BYWA-RBOF-27UZ-TBCW|0dd870adcadfcd18881dda15916784d5759e63ca|lin; Path=/; Secure
Strict-Transport-Security: max-age=315360000;includeSubDomains

{"expand":"re...}

What permissions does my user require to make use of this?

martinffx avatar Jun 26 '17 13:06 martinffx

Hi, I'm actually also using the call with the encrypted password, i'll send you a custom version with some printing enabled so we can see if the call is right. If it's working from the cmd i don't think you need anything else.

cristibaluta avatar Jun 27 '17 12:06 cristibaluta

Also having this issue. Keeps saying it might be my credentials.

Does jit handle special characters like / &

jflow avatar Jan 20 '19 03:01 jflow

I'll check and come back, didn't tested with this kind of password

cristibaluta avatar Jan 20 '19 07:01 cristibaluta

Hi, just reminded that i have a verbose mode in the latest version, could you add -v to your commands? For example "jit me -v". Thanks.

cristibaluta avatar Jan 21 '19 14:01 cristibaluta