lundi 17 décembre 2018

Dojo AJAX query with basic web Authorization

I am trying to do some Basic Authorization in Dojo, but the Server always returns Error 401. If I login with NTLM in my Browser, it works fine. But I need to access this Server in my Web-App.

var user = "usertest";
var password = "passwordtest";
dojo.xhr("GET", {   
    handleAs: "json",
    url: "http://172.17.46.3/AccCorp3-t1/hs/DataExchange/",
    headers: {"Authorization": "Basic " + btoa(user + ":" + password) },
});

And also I have an error with CORS... Something wrong with headers in query?

Access to XMLHttpRequest at 'http://172.17.46.3/AccCorp3-t1/hs/DataExchange/' from origin 'http://srv-logica.gpkk.local' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.




Aucun commentaire:

Enregistrer un commentaire