LaVOZs

The World’s Largest Online Community for Developers

'; ldap - Enable Encryption to existing JasperReports Server - LavOzs.Com

I'm not sure if this question was asked earlier. I've installed JasperReports Server separately on the Tomcat server. Normally Tomcat server comes with Jaspersoft installation setup but I have done it the other way. I'm having issues implementing encryption on applicationContext-externalAuth-LDAP.XML file. I was able to implement LDAP authentication successfully but the issue is, I'm manually setting up the applicationContext-externalAuth-LDAP.xml file using below settings. I need to encrypt the password supplied in this config file. Here is my code for LDAP:

<bean id="ldapContextSource" class="com.jaspersoft.jasperserver.api.security.externalAuth.ldap.JSLdapContextSource">
        <constructor-arg value="ldap://xyz:389/dc=test,dc=local"/>
        <!-- manager user name and password (may not be needed)  -->
        <property name="userDn" value="CN=TEST,OU=Test Users,DC=Test,DC=local"></property>
        <property name="password" value="Test123"></property>
        <property name="referral" value="follow"/>
    </bean>

From the docs:

In JasperReports Server v5.5 or greater, Buildomatic Password Encryption (PE) allows JasperReports Server administrators to obfuscate plain text database passwords in the configuration files. This satisfies the security audit requirements and protects the passwords from being observed by unauthorized individuals. PE happens during JasperReports Server installation. If the installation deploys to the Tomcat application server, the database password is automatically encrypted in the JNDI configuration as well (context.xml).

Buildomatic Password Encryption (PE) also lets admins encrypt certain default-master.properties. For example, quartz.mail.sender.password can be encrypted this way.

Specifically for LDAP (JasperReports Server >= v5.6):

You can configure the connection by setting the external.ldapUrl, external.ldapDn, and external.ldapPassword properties prior to installation or upgrade. At this time, you can optionally choose to encrypt any of the LDAP connection parameters. This is the preferred method for setting the LDAP connection parameters. See the JasperReports Server Administrator Guide for more information.

References in the Admin Guide depend on the version in use.

Related
Are HTTPS headers encrypted?
Encrypt and decrypt a string in C#?
Fundamental difference between Hashing and Encryption algorithms
JasperReports Server 5.2 Active Directory Integration
LDAP Authentication with Spring Security throwing LDAP error 49, 52e for any userDn
LDAP Error: “Server is not operational” from our server