Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You got this from <a href="https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Basic+Authentication" rel="noreferrer">here</a>, I presume. Well on the same page it is explained how to "do it yourself". I will "translate" the steps that you need to do in order to manage to do the same request in JS.</p> <ol> <li>Request Method should be <strong>GET</strong></li> <li>You should have 2 headers: <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html" rel="noreferrer">Authorization Header and Content-Type Header</a>. Your Content-type header should looks like: <strong>"Content-Type: application/json"</strong></li> </ol> <p>For the Authorization header:</p> <ol> <li>Build a string of the form <strong>username:password</strong></li> <li><a href="http://en.wikipedia.org/wiki/Base64" rel="noreferrer">Base64</a> encode the string (Use <a href="https://developer.mozilla.org/en-US/docs/DOM/window.btoa" rel="noreferrer">window.btoa()</a> and <a href="https://developer.mozilla.org/en-US/docs/DOM/window.atob" rel="noreferrer">window.atob()</a>) - <em>You actually DO NOT need the second one but I put it there for reference</em></li> <li>Supply an "Authorization" header with content "Basic " followed by the encoded string. For example, the string "fred:fred" encodes to "ZnJlZDpmcmVk" in base64, so your Authorization Header should look like": <strong>"Authorization: Basic ZnJlZDpmcmVk"</strong></li> </ol> <p>So in the end you need to make your GET request with the two Headers supplied and you should be Authorized. Also <strong>BEWARE Base64 is reverseable</strong> and NOT an encryption function. It is encoding. The request will go through HTTPS of course, but the Base64 encoded string could be reversed if SSL is broken.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload