Jump to content
JasperReports 7.0 is now available ×

Passing query parameters with authentication request visualize.js


Recommended Posts

I am using jasper's visualize.js to display report in a web page. I have created a sample html and need to perform the token based auth. Also i need to pass some query parameters with the auth request. below is my code

 

<!DOCTYPE html><html>  <head>  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>  <title></title>  </head>  <body><!-- Provide the URL to visualize.js --><div id="container"></div><!-- Provide a container for the report --><script src="http://localhost:8081/jasperserver-pro/client/visualize.js?logLevel=error&_opt=true"></script><script>var str = $.param({ districtId: 12345});visualize({  auth: {    token:"Bearer%20r5srPawAH6xzK8KlxqnkD8B1W4nS3SmZgxk1j4P4mRzCBwLArNGdTgKAlYuMQrwh",    queryParams:str,    preAuth: true,    tokenName:"token"  }}, function(v) {alert("success");},function(err){    alert(err);});</script>  </body></html>[/code]

I am getting error saying that queryParams in unknown property. I checked the API but it is there in the definition. What is wrong in my usage ?

Please help,

Thank you,

Thusira

Link to comment
Share on other sites

  • 3 years later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...