Token (in header) authentication giving CORS error on redirect

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,



christopher.canada's picture
Joined: Oct 7 2021 - 3:00pm
Last seen: 1 year 1 week ago

Pic 1, 2 and 4 were not uploaded unfortunately.

christopher.canada - 1 year 7 months ago

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,





christopher.canada - 1 year 7 months ago

0 Answers:

No answers yet