Jump to content
We've recently updated our Privacy Statement, available here ×

ioannis.anagnostopoulos

Members
  • Posts

    6
  • Joined

  • Last visited

ioannis.anagnostopoulos's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Our table has the default filter options over each column and works as expected. What we want to do is to apply a filter via javascript. As a simple example we would like to have a button with some text inputs and once the button is pressed the table to be filtered based on the values in the input controls. Thank you in advance. Y
  2. I think I have sorted the problem myself. However I would like to list the steps I took for verification as the solution might not be 100% correct. Please note that the only reference to the custom encryption issue in the manual is the following one at page 54: "If your database uses a different encryption algorithm, you can configure your own password encoder using the Spring implementations of the PasswordEncoder interface." This assumes, wrongly to my opinion, that the developer has spring framework knowledge and provides no guidance as to what needs to be done and where the configuration should be applied. So, to implement custom encryption the following steps must be performed: 1. Create a new class that implements the Spring PasswordEncoder interface. 2. Import the spring libraries to the project from Jasper 3. Import the custom encryption library (in our case it was jasypt.jar) 4. Implement the PasswordEncoder:encodePassord method, essentially wrapping in it the calls to the custom library to encode the password and return the encrypted password. 5. Implement the PasswordEncoder:isPasswordValid method, i.e. wrap the equivalent method of the custom encryption library and return true or false. 6. Build the new class and place it to the web-inf/lib or /classes of jasperserver-pro context along with the jar file of the custom library 7. Edit the applicationContext-externalAuth-db-mt.xml and replace the passwordValidator class with the namespace.className of the custom implementation. 7a. Remove any non applicable properties from the bean by commenting them out (in my case no properties were necessary) 8. Restart jasper As I said, this seems to be the minimum solution to my problem. I would really appreciate if someone could verify it. I must emphasise though that I would have expected a manual labeled as Cookbook to include some information along these lines. Kind Regards Yiannis
  3. The scenario in question is : sample-applicationContext-externalAuth-db-mt.xml but it does not cover SMD5 passwords neither the manual exaplains how to implement other security policies. It just mentions something about Implementing the PasswordEncoder spring security interface. So before I start reading about Spring (which I wouldn't like to be my priority right now) I hope for an answer here. Regards Y
  4. Hello, I am trying to configure an external database authentication but my spring knowledge is limited. I assume though that somehow I must provide in the xml file an implementation of the PasswordEncoder (probably Md5PasswordEncoder) as part of the validator to perform the encryption of the clear text and make the comparison. My external password are in the form of {SMD5}xxxxxx Are there any examples available? Kind Regards Y
  5. Hello all, I am new to jasper reports and even newer to the encryption concepts. Not sure if this has been answered before but I am not sure if my encryption code is wrong or I submit the encrypted credentials wrongly. So here is my java back end encryption code: [/code]KeyFactory keyFactory = KeyFactory.getInstance("RSA");RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(modulus, exponent);System.out.println("Got the RSAPublicKey now"); PublicKey key = keyFactory.generatePublic(pubKeySpec); Cipher cipher = Cipher.getInstance("RSA/NONE/NoPadding");System.out.println("nProvider is: " + cipher.getProvider().getInfo());// encrypt the plaintext using the public keycipher.init(Cipher.ENCRYPT_MODE, key);System.out.println("Init the cipher!!!");byte[] cipherText = cipher.doFinal("superuser".getBytes()); System.out.println("Surprise: " + cipherText);String json = gson.toJson(new LoginEncFactory(new String(cipherText)));System.out.println(json); response.setContentType("application/json");PrintWriter out = response.getWriter();out.print(json);out.flush();So providing that my json object in this example comes out as:{"userName":"superuser","password":"xªJTdÖu003c?®u001e:oÜÆu0001]U*ý÷ |aó¿âãæ؆u0003YtA°Kö‘ƒìkÎÝ羟…Ýi^ æ¦:?™L•u0007Èu0011´£,4úuOÊGu000e‰u001ehø›stu0012êu0012Ëu0007°,v›6u000eÄÔu0005u0012©™9€0ã-ª7‘KÑ}Ä"RÌm+u003cÝL-(þÕóԵʻ~u0003ü"} If I submit in the front end j_username=superuser&j_password=..... via my ajax XMLHttpRequest I get nowhere (access denied). But I am not sure if my encryption is wrong or the way I submit the encrypted credentials to jasper server. Any help will be much appreciated. Below is the ajax code: http = new XMLHttpRequest(); [/code]if ("withCredentials" in http) { http.withCredentials = true; } [/code]var url = "http://la01981:7001/jasperserver-pro/rest/login"; [/code]var params = "j_username=" + credentials.userName + "&j_password=" + credentials.password; [/code]alert("Will login with: " + params); [/code]http.open("POST", url, true); //Send the proper header information along with the request [/code]http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); [/code]http.setRequestHeader("Content-length", params.length); [/code]http.setRequestHeader("Origin", "http://la01981:8080"); [/code]http.setRequestHeader("charset", "utf-8");[/code]http.send(params);[/code] Kind RegardsYiannis
×
×
  • Create New...