UPDATE
So, the reason why I tried to do ajax is the login form, which display when user open SSRS reports in the application. I have frame with reports (two different servers) and want make authorization invisible for user in application. For the first server - kuybit I have it, but the SSRS has the other auth form type and I have a trouble with it. If anybody knows better way, except ajax request it can helps.
OLD Q VERSION
I have application and microsoft server for BI report in iframe. I am trying send cross domain ajax request to report server and it doesn't work, because the first request for cross domain is OPTIONS. And my ajax has never worked. My ajax request:
var path = route + ':444/ReportServer/Pages/ReportViewer.aspx' + reportName + '&rs:Command=Render&rc:stylesheet=HideToolBar';
$.ajax({
url: path,
type: 'GET',
headers: {
'Access-Control-Allow-Headers': 'Authorization',
'Content-Type':'application/xml',
'Authorization' : 'Basic ' + btoa(ssrs_login + ":" + ssrs_password)}
}).success(function (data) {
//todo smth
});
Can anybody helps, please.
To enable CORS to SSRS:
Set - AccessControlAllowCredentials to true <- to allow passing cookies - AccessControlAllowOrigin to the URL of your other server so the OPTION request can pass