JasperSoft visualize.js auth performs GET - password in Query String

187 Views Asked by At

I'm just starting with Visualize.js to embedd jasper reports in a web page.

The first hurdle I ran into was authenticating to the server. It kept failing with "Authentication Error"

Okay, double check password, still no worky. After tracking the requests, and following the same steps to authenticate to the server directly, I discovered that when using visualize.js, it places the userID/pwd in the query string and performs a GET request. WHAT!? The problem was that I had special characters in the password that were not URL friendly. So, not only are they putting clear text passwords in the request URL, they aren't bothering to URL encode it.

I fixed it by encoding it myself, but this is blasphemy if you ask me. The userID and password will be in clear text in the request whether you are using SSL/TSL or not. Why on earth aren't they doing a POST?

So, the actual question: Is there a way to configure this to use POST instead of GET for the auth process?

This code does work, but again it is processed as a GET. The standard jasper login page does not do that.

            visualize({
                          server: "http://myseverurl/jasperserver-pro",
                          auth: {
                              name : "myUserID",
                              password: encodeURIComponent("myWierdPassword**+&&&")
                          }
            }, function(v){
                alert('in callback');
            }, function(err){
                alert("ERROR: " + JSON.stringify(err));
            });
0

There are 0 best solutions below