JavaScript Basic Auth not working in jquery but working in other languages basic auth work,basic auth not working in postman,basic

I am trying to authenticate a user using the Basic Authentication protocol in Jquery but it keeps giving error:"XMLHttpRequest cannot load https://api.credly.com/v1.1/authenticate. Request header field authorization is not allowed by Access-Control-Allow-Headers."

But when I check the API using postman client, it works fine.

Jquery Code:

 var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.credly.com/v1.1/authenticate",
  "method": "POST",
  "headers": {
    "x-api-key": "myAPIkey",
    "x-api-secret": "mySECRET",
    "authorization": "Basic "+btoa(<email> + ":" + <password>)
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

the API is working for POSTMAN client so there should be no issue in that but it is not working in Jquery. Please help.

Answer:1

I was wondering if there is a better way to do this: var books = [ { title: 'Some Book', author: { firstName: 'John', lastName: 'Doe' } }, { title: ...

I was wondering if there is a better way to do this: var books = [ { title: 'Some Book', author: { firstName: 'John', lastName: 'Doe' } }, { title: ...

I have searched in many ways to get the solution of this problem but not found any working solution. I have visited many questions on this platform but not found any working solution. I know that i ...

I have searched in many ways to get the solution of this problem but not found any working solution. I have visited many questions on this platform but not found any working solution. I know that i ...

I am trying to make a append menu on click div. But i have one question here. How can i remove appended elements after second click. Anyone can help me in this regard ? This is the DEMO page from ...

I am trying to make a append menu on click div. But i have one question here. How can i remove appended elements after second click. Anyone can help me in this regard ? This is the DEMO page from ...

  1. jquery click append
  2. jquery click append element
  3. jquery click append div
  4. jquery click append html
  5. jquery append click event
  6. jquery append click not working
  7. jquery append click handler
  8. jquery append click function
  9. jquery click after append
  10. jquery button click append div
  11. jquery after append click not working
  12. jquery click event after append
  13. jquery click event on append element
  14. jquery click function after append
  15. jquery append add click event
  16. jquery click doesn't work after append
  17. jquery click on element after append
  18. jquery bind click after append
  19. jquery trigger click after append

I understand that when index names are used to push values in Javascript, they essentially work like objects. But what I don't understand is the following behaviour - person = []; person[0] = "...

I understand that when index names are used to push values in Javascript, they essentially work like objects. But what I don't understand is the following behaviour - person = []; person[0] = "...