I have tried to integrate the Knowage BI tool in an ASP.Net application and getting an error.
Error: Failed to load
http://www.localhost:8080/knowage/servlet/AdapterHTTP?ACTION_NAME=LOGIN_ACTION_WEB&NEW_SESSION=TRUE: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'null' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
Code:
<script type="text/javascript">
/*
* setup some basic informations in order to invoke Knowage server's services
*/
Sbi.sdk.services.setBaseUrl({
protocol: 'http'
, host: 'localhost'
, port: '8080'
, contextPath: 'knowage'
, controllerPath: 'servlet/AdapterHTTP'
});
doLogin = function() {
var user = 'biadmin';
var password = 'biadmin';
/*
* the callback invoked uppon request termination
*
* @param xhr the XMLHttpRequest object
*/
var cb = function(xhr) {
var description = document.getElementById('introduction');
var authenticationEl = document.getElementById('authentication');
var examplesEl = document.getElementById('examples');
authenticationEl.style.display = "none";
description.style.display = "none";
examplesEl.style.display = "inline";
};
/*
* authentication function
*
* @param credentials the list of parameters to pass to the authentication servics (i.e. user & password)
* @param headers an array containing the headers of the request
* @param callbackOk the callback function to be called after success response
* @param callbackError (optional) the callback function to be called after error response
*/
Sbi.sdk.cors.api.authenticate({
credentials: 'user=' + user + '&password=' + password
, headers: [{
name: 'Content-Type',
value: 'application/x-www-form-urlencoded',
}]
, callbackOk: cb
})
}
</script>
Looking forward to get some help to fix mentioned issue.
Thank You