Our application is written in Angular 9 and we are integrating JasperReports Server 7.9 to provide reports and dashboards.
We are in development currently and have the reports server and the application running in the same localhost. Application is at http://localhost:4200 and JasperReports Server is http://localhost:8080/jasperserver-pro
Attached as pic 1 is the loginFn
Attached as pic 2 is the visualize call
Attached as pic 3 is the CORS error from the console
Attached as pic 4 is the results in the network tab from dev tools
Pic 4 shows a redirect took place from jasperserver-pro/ to loginSuccess.json. This is where the error seems to be. Access-Control-Allow-Origin is set to * and the browser is producing a CORS error because of it.
Any help would be greatly appreciated and would provide further details if needed.
Thank you,
Chris
Pic 1, 2 and 4 were not uploaded unfortunately.
I don't like this formatting but below is the content of pic 1. The loginFn contents.
userAuth = {
preAuth: true,
token: this.token,
loginFn: function(properties,request) {
return request({
url: 'http://localhost:8080/jasperserver-pro/',
type: 'get',
headers: {
'pp' : properties.token,
'Accept' : 'application/json',
'withCredentials' : true,
}
});
}
};