title: Okta API or standard CURL/ajax problems
body: <p>I'm looking to pull the current user's login name from the Okta API, but I'm usually just an HTML/CSS guy so I'm struggling. I'm currently stuck with this:</p>
  
  <pre><code>&lt;head&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  jQuery.ajax({
      url: "https://harmelin.okta.com/api/v1/users/me",
  
      type: 'GET',
      dataType: 'json',
      contentType: 'application/json',
      processData: false,
      success: function (data) {
        alert(JSON.stringify(data));
      },
      error: function(){
        alert("Cannot get data");
      }
  });
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;script type="text/javascript"&gt;
      document.write(data.profile.login);
  &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>I've used parts of that code in the past with other APIs but had to go a little hack on it. I know that my problem is authorization as I'm getting a 403 error. The Okta documentation gives this as a request example:</p>
  
  <pre><code>curl -v -X GET \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Authorization: SSWS ${api_token}" \
  "https://${org}.okta.com/api/v1/users/me"
  </code></pre>
  
  <p>How do I get the authorization in my script? Will that provide me with what I need for future development (data.profile.login)?</p>