bixia.ji Posted August 27, 2015 Share Posted August 27, 2015 We are using visualize.js to embed jasper report. When trying to use pre-authentication token for login in, first we ran into problem that refreshing page does not work. By adding logout on event beforeunload, refreshing works now (http://community.jaspersoft.com/questions/851277/sso-pre-auth-visualize). (BTW, this is not ideal way)However if I open the report page in another tab, the new tab would not work due to authentication error until the jasper session expires. I traced the problem to REST api call to http://bjil01:8180/jasperserver-pro/?pp=xxxx. When the api call returns 302, it's treated as authentication success, and when the api return 200, it's treated as authentication failure. Shouldn't http code 200 be treated as user already logged in and thus allow report being shown? 401 is the code to indicate authentication error. Link to comment Share on other sites More sharing options...
Solution bixia.ji Posted August 27, 2015 Author Solution Share Posted August 27, 2015 I tried to update the file jasperserver-pro/scripts/bower_components/js-sdk/src/common/auth/Authentication.js to handle 200 as success, adding the following code: if (a === "success" && b.status == 200) { result = {success: true}; dfd.resolve(result); return dfd; } [/code] after line 60 if(typeof response === "string"){[/code] Multiple tabs work with the change now. With this change, page refresh would also work without adding logout step following http://community.jaspersoft.com/questions/851277/sso-pre-auth-visualize Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now